Coverage Report

Created: 2026-09-16 05:29

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/operator/operator.cpp
Line
Count
Source
1
// Licensed to the Apache Software Foundation (ASF) under one
2
// or more contributor license agreements.  See the NOTICE file
3
// distributed with this work for additional information
4
// regarding copyright ownership.  The ASF licenses this file
5
// to you under the Apache License, Version 2.0 (the
6
// "License"); you may not use this file except in compliance
7
// with the License.  You may obtain a copy of the License at
8
//
9
//   http://www.apache.org/licenses/LICENSE-2.0
10
//
11
// Unless required by applicable law or agreed to in writing,
12
// software distributed under the License is distributed on an
13
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
// KIND, either express or implied.  See the License for the
15
// specific language governing permissions and limitations
16
// under the License.
17
18
#include "exec/operator/operator.h"
19
20
#include <algorithm>
21
22
#include "common/status.h"
23
#include "exec/common/util.hpp"
24
#include "exec/exchange/local_exchange_sink_operator.h"
25
#include "exec/exchange/local_exchange_source_operator.h"
26
#include "exec/operator/aggregation_sink_operator.h"
27
#include "exec/operator/aggregation_source_operator.h"
28
#include "exec/operator/analytic_sink_operator.h"
29
#include "exec/operator/analytic_source_operator.h"
30
#include "exec/operator/assert_num_rows_operator.h"
31
#include "exec/operator/blackhole_sink_operator.h"
32
#include "exec/operator/bucketed_aggregation_sink_operator.h"
33
#include "exec/operator/bucketed_aggregation_source_operator.h"
34
#include "exec/operator/cache_sink_operator.h"
35
#include "exec/operator/cache_source_operator.h"
36
#include "exec/operator/datagen_operator.h"
37
#include "exec/operator/dict_sink_operator.h"
38
#include "exec/operator/distinct_streaming_aggregation_operator.h"
39
#include "exec/operator/empty_set_operator.h"
40
#include "exec/operator/exchange_sink_operator.h"
41
#include "exec/operator/exchange_source_operator.h"
42
#include "exec/operator/file_scan_operator.h"
43
#include "exec/operator/group_commit_block_sink_operator.h"
44
#include "exec/operator/group_commit_scan_operator.h"
45
#include "exec/operator/hashjoin_build_sink.h"
46
#include "exec/operator/hashjoin_probe_operator.h"
47
#include "exec/operator/hive_table_sink_operator.h"
48
#include "exec/operator/iceberg_delete_sink_operator.h"
49
#include "exec/operator/iceberg_merge_sink_operator.h"
50
#include "exec/operator/iceberg_table_sink_operator.h"
51
#include "exec/operator/jdbc_scan_operator.h"
52
#include "exec/operator/jdbc_table_sink_operator.h"
53
#include "exec/operator/local_merge_sort_source_operator.h"
54
#include "exec/operator/materialization_opertor.h"
55
#include "exec/operator/maxcompute_table_sink_operator.h"
56
#include "exec/operator/memory_scratch_sink_operator.h"
57
#include "exec/operator/meta_scan_operator.h"
58
#include "exec/operator/mock_operator.h"
59
#include "exec/operator/mock_scan_operator.h"
60
#include "exec/operator/multi_cast_data_stream_sink.h"
61
#include "exec/operator/multi_cast_data_stream_source.h"
62
#include "exec/operator/nested_loop_join_build_operator.h"
63
#include "exec/operator/nested_loop_join_probe_operator.h"
64
#include "exec/operator/olap_scan_operator.h"
65
#include "exec/operator/olap_table_sink_operator.h"
66
#include "exec/operator/olap_table_sink_v2_operator.h"
67
#include "exec/operator/partition_sort_sink_operator.h"
68
#include "exec/operator/partition_sort_source_operator.h"
69
#include "exec/operator/partitioned_aggregation_sink_operator.h"
70
#include "exec/operator/partitioned_aggregation_source_operator.h"
71
#include "exec/operator/partitioned_hash_join_probe_operator.h"
72
#include "exec/operator/partitioned_hash_join_sink_operator.h"
73
#include "exec/operator/rec_cte_anchor_sink_operator.h"
74
#include "exec/operator/rec_cte_scan_operator.h"
75
#include "exec/operator/rec_cte_sink_operator.h"
76
#include "exec/operator/rec_cte_source_operator.h"
77
#include "exec/operator/repeat_operator.h"
78
#include "exec/operator/result_file_sink_operator.h"
79
#include "exec/operator/result_sink_operator.h"
80
#include "exec/operator/schema_scan_operator.h"
81
#include "exec/operator/select_operator.h"
82
#include "exec/operator/set_probe_sink_operator.h"
83
#include "exec/operator/set_sink_operator.h"
84
#include "exec/operator/set_source_operator.h"
85
#include "exec/operator/sort_sink_operator.h"
86
#include "exec/operator/sort_source_operator.h"
87
#include "exec/operator/spill_iceberg_table_sink_operator.h"
88
#include "exec/operator/spill_sort_sink_operator.h"
89
#include "exec/operator/spill_sort_source_operator.h"
90
#include "exec/operator/streaming_aggregation_operator.h"
91
#include "exec/operator/table_function_operator.h"
92
#include "exec/operator/tvf_table_sink_operator.h"
93
#include "exec/operator/union_sink_operator.h"
94
#include "exec/operator/union_source_operator.h"
95
#include "exec/pipeline/dependency.h"
96
#include "exec/pipeline/pipeline.h"
97
#include "exprs/vexpr.h"
98
#include "exprs/vexpr_context.h"
99
#include "runtime/runtime_profile.h"
100
#include "runtime/runtime_profile_counter_names.h"
101
#include "util/debug_util.h"
102
#include "util/string_util.h"
103
104
namespace doris {
105
class RowDescriptor;
106
class RuntimeState;
107
} // namespace doris
108
109
namespace doris {
110
111
0
Status OperatorBase::close(RuntimeState* state) {
112
0
    if (_is_closed) {
113
0
        return Status::OK();
114
0
    }
115
0
    _is_closed = true;
116
0
    return Status::OK();
117
0
}
118
119
template <typename SharedStateArg>
120
1.78M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.78M
    if (_parent->nereids_id() == -1) {
122
937k
        return fmt::format("(id={})", _parent->node_id());
123
937k
    } else {
124
851k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
851k
    }
126
1.78M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
72.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
72.6k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
72.6k
    } else {
124
72.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
72.6k
    }
126
72.6k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1
    if (_parent->nereids_id() == -1) {
122
1
        return fmt::format("(id={})", _parent->node_id());
123
1
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
209k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
209k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
209k
    } else {
124
209k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
209k
    }
126
209k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
25
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
25
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
25
    } else {
124
25
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
25
    }
126
25
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.03k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.03k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
8.03k
    } else {
124
8.03k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.03k
    }
126
8.03k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
7.51k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
7.51k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
7.50k
    } else {
124
7.50k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
7.50k
    }
126
7.51k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
90.2k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
90.2k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
90.1k
    } else {
124
90.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
90.1k
    }
126
90.2k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.9k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.9k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
54.9k
    } else {
124
54.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.9k
    }
126
54.9k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
64
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
64
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
64
    } else {
124
64
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
64
    }
126
64
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
629k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
629k
    if (_parent->nereids_id() == -1) {
122
280k
        return fmt::format("(id={})", _parent->node_id());
123
348k
    } else {
124
348k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
348k
    }
126
629k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.7k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.7k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
54.7k
    } else {
124
54.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.7k
    }
126
54.7k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
6.31k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.32k
    if (_parent->nereids_id() == -1) {
122
6.32k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
6.31k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
433
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
433
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
331
    } else {
124
331
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
331
    }
126
433
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
4.89k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.89k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
4.87k
    } else {
124
4.87k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
4.87k
    }
126
4.89k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
650k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
650k
    if (_parent->nereids_id() == -1) {
122
650k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
650k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
169
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
169
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
169
    } else {
124
169
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
169
    }
126
169
}
127
128
template <typename SharedStateArg>
129
1.17M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.17M
    if (_parent->nereids_id() == -1) {
131
670k
        return fmt::format("(id={})", _parent->node_id());
132
670k
    } else {
133
507k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
507k
    }
135
1.17M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
122k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
122k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
122k
    } else {
133
122k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
122k
    }
135
122k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
2
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
2
    if (_parent->nereids_id() == -1) {
131
1
        return fmt::format("(id={})", _parent->node_id());
132
1
    } else {
133
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
1
    }
135
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
212k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
212k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
212k
    } else {
133
212k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
212k
    }
135
212k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
32
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
32
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
32
    } else {
133
32
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
32
    }
135
32
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.24k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.24k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
8.24k
    } else {
133
8.24k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.24k
    }
135
8.24k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.52k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.52k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
7.51k
    } else {
133
7.51k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.51k
    }
135
7.52k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
91.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
91.0k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
91.0k
    } else {
133
91.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
91.0k
    }
135
91.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
54.7k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
54.7k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
54.7k
    } else {
133
54.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
54.7k
    }
135
54.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
74
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
74
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
74
    } else {
133
74
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
74
    }
135
74
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
9
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
9
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
9
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
9
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
11.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
11.0k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
11.0k
    } else {
133
11.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
11.0k
    }
135
11.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
432
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
432
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
330
    } else {
133
330
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
330
    }
135
432
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.5k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.5k
    if (_parent->nereids_id() == -1) {
131
12.5k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
12.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
245k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
246k
    if (_parent->nereids_id() == -1) {
131
246k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
245k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
411k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
411k
    if (_parent->nereids_id() == -1) {
131
411k
        return fmt::format("(id={})", _parent->node_id());
132
18.4E
    } else {
133
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
18.4E
    }
135
411k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
25
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
25
    if (_parent->nereids_id() == -1) {
131
25
        return fmt::format("(id={})", _parent->node_id());
132
25
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
338
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
338
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
338
    } else {
133
338
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
338
    }
135
338
}
136
137
template <typename SharedStateArg>
138
31.3k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
31.3k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
31.3k
    _terminated = true;
143
31.3k
    return Status::OK();
144
31.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2.45k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.45k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.45k
    _terminated = true;
143
2.45k
    return Status::OK();
144
2.45k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
5
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
5
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
5
    _terminated = true;
143
5
    return Status::OK();
144
5
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2.22k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.22k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.22k
    _terminated = true;
143
2.22k
    return Status::OK();
144
2.22k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
927
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
927
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
927
    _terminated = true;
143
927
    return Status::OK();
144
927
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
451
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
451
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
451
    _terminated = true;
143
451
    return Status::OK();
144
451
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
339
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
339
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
339
    _terminated = true;
143
339
    return Status::OK();
144
339
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
5
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
5
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
5
    _terminated = true;
143
5
    return Status::OK();
144
5
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
186
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
186
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
186
    _terminated = true;
143
186
    return Status::OK();
144
186
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
14
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
14
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
14
    _terminated = true;
143
14
    return Status::OK();
144
14
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
543
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
543
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
543
    _terminated = true;
143
543
    return Status::OK();
144
543
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
139
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
139
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
139
    _terminated = true;
143
139
    return Status::OK();
144
139
}
145
146
296k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
296k
    return _child && _child->is_serial_operator() && !is_source()
148
296k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
296k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
296k
}
151
152
19.8k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
19.8k
    if (!_child) {
154
18.7k
        return false;
155
18.7k
    }
156
1.14k
    if (_child->is_serial_operator()) {
157
123
        return true;
158
123
    }
159
1.02k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.02k
    return child_distribution.need_local_exchange() &&
161
1.02k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.14k
}
163
164
template <typename SharedStateArg>
165
19.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.6k
    fmt::memory_buffer debug_string_buffer;
167
19.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.6k
    return fmt::to_string(debug_string_buffer);
169
19.6k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
3
    fmt::memory_buffer debug_string_buffer;
167
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
3
    return fmt::to_string(debug_string_buffer);
169
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
19.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
19.6k
    fmt::memory_buffer debug_string_buffer;
167
19.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
19.6k
    return fmt::to_string(debug_string_buffer);
169
19.6k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
1
    fmt::memory_buffer debug_string_buffer;
167
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
1
    return fmt::to_string(debug_string_buffer);
169
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
170
171
template <typename SharedStateArg>
172
19.6k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.6k
    fmt::memory_buffer debug_string_buffer;
174
19.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.6k
    return fmt::to_string(debug_string_buffer);
176
19.6k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
172
19.6k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
19.6k
    fmt::memory_buffer debug_string_buffer;
174
19.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
19.6k
    return fmt::to_string(debug_string_buffer);
176
19.6k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
19.6k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
19.6k
    fmt::memory_buffer debug_string_buffer;
180
19.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
19.6k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
19.6k
                   _is_serial_operator);
183
19.6k
    return fmt::to_string(debug_string_buffer);
184
19.6k
}
185
186
19.6k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
19.6k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
19.6k
}
189
190
646k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
646k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
646k
    _nereids_id = tnode.nereids_id;
193
646k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.86k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.86k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.86k
            tnode.intermediate_projections_list.size()) {
199
0
            return Status::InternalError(
200
0
                    "intermediate_output_tuple_id_list size:{} not match "
201
0
                    "intermediate_projections_list size:{}",
202
0
                    tnode.intermediate_output_tuple_id_list.size(),
203
0
                    tnode.intermediate_projections_list.size());
204
0
        }
205
3.86k
    }
206
646k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
646k
    _op_name = substr + "_OPERATOR";
208
209
646k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
646k
    } else if (tnode.__isset.conjuncts) {
212
271k
        for (const auto& conjunct : tnode.conjuncts) {
213
271k
            VExprContextSPtr context;
214
271k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
271k
            _conjuncts.emplace_back(context);
216
271k
        }
217
98.5k
    }
218
219
    // create the projections expr
220
646k
    if (tnode.__isset.projections) {
221
259k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
259k
    }
223
646k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.86k
        DCHECK(has_projection()) << "no final projections";
225
3.86k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.49k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.49k
            VExprContextSPtrs projections;
228
6.49k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.49k
            _projection->intermediate_projections.push_back(projections);
230
6.49k
        }
231
3.86k
    }
232
646k
    return Status::OK();
233
646k
}
234
235
673k
Status OperatorXBase::prepare(RuntimeState* state) {
236
673k
    for (auto& conjunct : _conjuncts) {
237
271k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
271k
    }
239
673k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
623k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
337k
            return a->execute_cost() < b->execute_cost();
242
337k
        });
243
623k
    };
244
245
673k
    if (has_projection()) {
246
258k
        auto& projection = *_projection;
247
265k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.49k
            const auto& input_row_desc =
249
6.49k
                    i == 0 ? operator_row_desc_before_projection()
250
6.49k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.49k
            RETURN_IF_ERROR(
252
6.49k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.49k
        }
254
258k
        const auto& final_projection_input_row_desc =
255
258k
                projection.intermediate_output_row_descriptors.empty()
256
258k
                        ? operator_row_desc_before_projection()
257
258k
                        : projection.intermediate_output_row_descriptors.back();
258
258k
        RETURN_IF_ERROR(
259
258k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
258k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
258k
                                                      projection.output_row_descriptor));
262
258k
    }
263
264
673k
    for (auto& conjunct : _conjuncts) {
265
271k
        RETURN_IF_ERROR(conjunct->open(state));
266
271k
    }
267
673k
    if (has_projection()) {
268
258k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
258k
        for (auto& projections : _projection->intermediate_projections) {
270
6.49k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.49k
        }
272
258k
    }
273
673k
    if (_child && !is_source()) {
274
96.1k
        RETURN_IF_ERROR(_child->prepare(state));
275
96.1k
    }
276
277
673k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
673k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
673k
    return Status::OK();
283
673k
}
284
285
8.12k
Status OperatorXBase::terminate(RuntimeState* state) {
286
8.12k
    if (_child && !is_source()) {
287
777
        RETURN_IF_ERROR(_child->terminate(state));
288
777
    }
289
8.12k
    auto result = state->get_local_state_result(operator_id());
290
8.12k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
8.12k
    return result.value()->terminate(state);
294
8.12k
}
295
296
4.91M
Status OperatorXBase::close(RuntimeState* state) {
297
4.91M
    if (_child && !is_source()) {
298
845k
        RETURN_IF_ERROR(_child->close(state));
299
845k
    }
300
4.91M
    auto result = state->get_local_state_result(operator_id());
301
4.91M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.91M
    return result.value()->close(state);
305
4.91M
}
306
307
285k
void PipelineXLocalStateBase::clear_origin_block() {
308
285k
    _origin_block.clear_column_data(
309
285k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
285k
}
311
312
636k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
636k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
636k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
636k
    return Status::OK();
317
636k
}
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
285k
                                     Block* output_block) const {
326
285k
    auto* local_state = state->get_local_state(operator_id());
327
285k
    SCOPED_TIMER(local_state->exec_time_counter());
328
285k
    SCOPED_TIMER(local_state->_projection_timer);
329
285k
    const size_t rows = origin_block->rows();
330
285k
    if (rows == 0) {
331
154k
        return Status::OK();
332
154k
    }
333
131k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
131k
    {
336
131k
        Block input_block = *origin_block;
337
338
131k
        ColumnsWithTypeAndName new_columns;
339
131k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.60k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.60k
            new_columns.resize(projections.size());
345
69.4k
            for (int i = 0; i < projections.size(); i++) {
346
65.8k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
65.8k
                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
65.8k
            }
355
3.59k
            Block tmp_block {new_columns};
356
3.59k
            input_block.swap(tmp_block);
357
3.59k
        }
358
359
131k
        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
131k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
131k
                output_block, _projection->output_row_descriptor);
368
131k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
131k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
131k
        Columns shared_columns(mutable_columns.size());
371
372
755k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
624k
            ColumnPtr column_ptr;
374
624k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
624k
            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
624k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
624k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
624k
            if (column_ptr->is_exclusive()) {
386
225k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
399k
            } else {
388
399k
                shared_columns[i] = std::move(column_ptr);
389
399k
            }
390
624k
        }
391
392
130k
        scoped_mutable_block.restore();
393
755k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
624k
            if (shared_columns[i]) {
395
399k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
399k
            }
397
624k
        }
398
130k
    }
399
400
0
    origin_block->clear_column_data(
401
130k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
130k
    DCHECK_EQ(output_block->rows(), rows);
403
404
130k
    return Status::OK();
405
131k
}
406
407
4.32M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.32M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.32M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.32M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.32M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.32M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.32M
            if (_debug_point_count++ % 2 == 0) {
414
4.32M
                return Status::OK();
415
4.32M
            }
416
4.32M
        }
417
4.32M
    });
418
419
4.32M
    Status status;
420
4.32M
    auto* local_state = state->get_local_state(operator_id());
421
4.32M
    Defer defer([&]() {
422
4.32M
        if (status.ok()) {
423
4.32M
            local_state->update_output_block_counters(*block);
424
4.32M
        }
425
4.32M
    });
426
4.32M
    if (has_projection()) {
427
285k
        local_state->clear_origin_block();
428
285k
        status = get_block(state, &local_state->_origin_block, eos);
429
285k
        if (UNLIKELY(!status.ok())) {
430
24
            return status;
431
24
        }
432
285k
        status = do_projections(state, &local_state->_origin_block, block);
433
285k
        return status;
434
285k
    }
435
4.03M
    status = get_block(state, block, eos);
436
4.03M
    RETURN_IF_ERROR(block->check_type_and_column());
437
4.03M
    return status;
438
4.03M
}
439
440
2.68M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.68M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.49k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.49k
        *eos = true;
444
9.49k
    }
445
446
2.68M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.68M
        auto op_name = to_lower(_parent->_op_name);
448
2.68M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.68M
        arg_op_name = to_lower(arg_op_name);
450
451
2.68M
        if (op_name == arg_op_name) {
452
2.68M
            *eos = true;
453
2.68M
        }
454
2.68M
    });
455
456
2.68M
    if (auto rows = block->rows()) {
457
776k
        _num_rows_returned += rows;
458
776k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
776k
    }
460
2.68M
}
461
462
31.3k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
31.3k
    auto result = state->get_sink_local_state_result();
464
31.3k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
31.3k
    return result.value()->terminate(state);
468
31.3k
}
469
470
19.6k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
19.6k
    fmt::memory_buffer debug_string_buffer;
472
473
19.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
19.6k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
19.6k
    return fmt::to_string(debug_string_buffer);
476
19.6k
}
477
478
19.6k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
19.6k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
19.6k
}
481
482
337k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
337k
    std::string op_name = "UNKNOWN_SINK";
484
337k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
338k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
338k
        op_name = it->second;
488
338k
    }
489
337k
    _name = op_name + "_OPERATOR";
490
337k
    return Status::OK();
491
337k
}
492
493
286k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
286k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
286k
    _nereids_id = tnode.nereids_id;
496
286k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
286k
    _name = substr + "_SINK_OPERATOR";
498
286k
    return Status::OK();
499
286k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.70M
                                                            LocalSinkStateInfo& info) {
504
1.70M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.70M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.70M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.70M
    return Status::OK();
508
1.70M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
122k
                                                            LocalSinkStateInfo& info) {
504
122k
    auto local_state = LocalStateType::create_unique(this, state);
505
122k
    RETURN_IF_ERROR(local_state->init(state, info));
506
122k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
122k
    return Status::OK();
508
122k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
365k
                                                            LocalSinkStateInfo& info) {
504
365k
    auto local_state = LocalStateType::create_unique(this, state);
505
365k
    RETURN_IF_ERROR(local_state->init(state, info));
506
365k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
365k
    return Status::OK();
508
365k
}
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
361
                                                            LocalSinkStateInfo& info) {
504
361
    auto local_state = LocalStateType::create_unique(this, state);
505
361
    RETURN_IF_ERROR(local_state->init(state, info));
506
361
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
361
    return Status::OK();
508
361
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
46.7k
                                                            LocalSinkStateInfo& info) {
504
46.7k
    auto local_state = LocalStateType::create_unique(this, state);
505
46.7k
    RETURN_IF_ERROR(local_state->init(state, info));
506
46.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
46.7k
    return Status::OK();
508
46.7k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8
                                                            LocalSinkStateInfo& info) {
504
8
    auto local_state = LocalStateType::create_unique(this, state);
505
8
    RETURN_IF_ERROR(local_state->init(state, info));
506
8
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8
    return Status::OK();
508
8
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
7.51k
                                                            LocalSinkStateInfo& info) {
504
7.51k
    auto local_state = LocalStateType::create_unique(this, state);
505
7.51k
    RETURN_IF_ERROR(local_state->init(state, info));
506
7.51k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
7.51k
    return Status::OK();
508
7.51k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6
                                                            LocalSinkStateInfo& info) {
504
6
    auto local_state = LocalStateType::create_unique(this, state);
505
6
    RETURN_IF_ERROR(local_state->init(state, info));
506
6
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6
    return Status::OK();
508
6
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
213k
                                                            LocalSinkStateInfo& info) {
504
213k
    auto local_state = LocalStateType::create_unique(this, state);
505
213k
    RETURN_IF_ERROR(local_state->init(state, info));
506
213k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
213k
    return Status::OK();
508
213k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
32
                                                            LocalSinkStateInfo& info) {
504
32
    auto local_state = LocalStateType::create_unique(this, state);
505
32
    RETURN_IF_ERROR(local_state->init(state, info));
506
32
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
32
    return Status::OK();
508
32
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
245k
                                                            LocalSinkStateInfo& info) {
504
245k
    auto local_state = LocalStateType::create_unique(this, state);
505
245k
    RETURN_IF_ERROR(local_state->init(state, info));
506
245k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
245k
    return Status::OK();
508
245k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
91.1k
                                                            LocalSinkStateInfo& info) {
504
91.1k
    auto local_state = LocalStateType::create_unique(this, state);
505
91.1k
    RETURN_IF_ERROR(local_state->init(state, info));
506
91.1k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
91.1k
    return Status::OK();
508
91.1k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
54.8k
                                                            LocalSinkStateInfo& info) {
504
54.8k
    auto local_state = LocalStateType::create_unique(this, state);
505
54.8k
    RETURN_IF_ERROR(local_state->init(state, info));
506
54.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
54.8k
    return Status::OK();
508
54.8k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
74
                                                            LocalSinkStateInfo& info) {
504
74
    auto local_state = LocalStateType::create_unique(this, state);
505
74
    RETURN_IF_ERROR(local_state->init(state, info));
506
74
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
74
    return Status::OK();
508
74
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
519k
                                                            LocalSinkStateInfo& info) {
504
519k
    auto local_state = LocalStateType::create_unique(this, state);
505
519k
    RETURN_IF_ERROR(local_state->init(state, info));
506
519k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
519k
    return Status::OK();
508
519k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.26k
                                                            LocalSinkStateInfo& info) {
504
8.26k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.26k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.26k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.26k
    return Status::OK();
508
8.26k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
11.0k
                                                            LocalSinkStateInfo& info) {
504
11.0k
    auto local_state = LocalStateType::create_unique(this, state);
505
11.0k
    RETURN_IF_ERROR(local_state->init(state, info));
506
11.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
11.0k
    return Status::OK();
508
11.0k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_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_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
330
                                                            LocalSinkStateInfo& info) {
504
330
    auto local_state = LocalStateType::create_unique(this, state);
505
330
    RETURN_IF_ERROR(local_state->init(state, info));
506
330
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
330
    return Status::OK();
508
330
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.78k
                                                            LocalSinkStateInfo& info) {
504
4.78k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.78k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.78k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.78k
    return Status::OK();
508
4.78k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.60k
                                                            LocalSinkStateInfo& info) {
504
2.60k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.60k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.60k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.60k
    return Status::OK();
508
2.60k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.59k
                                                            LocalSinkStateInfo& info) {
504
2.59k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.59k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.59k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.59k
    return Status::OK();
508
2.59k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.52k
                                                            LocalSinkStateInfo& info) {
504
2.52k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.52k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.52k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.52k
    return Status::OK();
508
2.52k
}
_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
563
                                                            LocalSinkStateInfo& info) {
504
563
    auto local_state = LocalStateType::create_unique(this, state);
505
563
    RETURN_IF_ERROR(local_state->init(state, info));
506
563
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
563
    return Status::OK();
508
563
}
_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
105
                                                            LocalSinkStateInfo& info) {
504
105
    auto local_state = LocalStateType::create_unique(this, state);
505
105
    RETURN_IF_ERROR(local_state->init(state, info));
506
105
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
105
    return Status::OK();
508
105
}
_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.37M
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.37M
    } else {
519
1.37M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.37M
        ss->id = operator_id();
521
1.37M
        for (auto& dest : dests_id()) {
522
1.36M
            ss->related_op_ids.insert(dest);
523
1.36M
        }
524
1.37M
        return ss;
525
1.37M
    }
526
1.37M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
110k
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
110k
    } else {
519
110k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
110k
        ss->id = operator_id();
521
110k
        for (auto& dest : dests_id()) {
522
109k
            ss->related_op_ids.insert(dest);
523
109k
        }
524
110k
        return ss;
525
110k
    }
526
110k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
366k
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
366k
    } else {
519
366k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
366k
        ss->id = operator_id();
521
366k
        for (auto& dest : dests_id()) {
522
364k
            ss->related_op_ids.insert(dest);
523
364k
        }
524
366k
        return ss;
525
366k
    }
526
366k
}
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
359
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
359
    } else {
519
359
        auto ss = LocalStateType::SharedStateType::create_shared();
520
359
        ss->id = operator_id();
521
360
        for (auto& dest : dests_id()) {
522
360
            ss->related_op_ids.insert(dest);
523
360
        }
524
359
        return ss;
525
359
    }
526
359
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
46.8k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
46.8k
    } else {
519
46.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
46.8k
        ss->id = operator_id();
521
46.8k
        for (auto& dest : dests_id()) {
522
46.5k
            ss->related_op_ids.insert(dest);
523
46.5k
        }
524
46.8k
        return ss;
525
46.8k
    }
526
46.8k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
8
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
8
    } else {
519
8
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8
        ss->id = operator_id();
521
8
        for (auto& dest : dests_id()) {
522
8
            ss->related_op_ids.insert(dest);
523
8
        }
524
8
        return ss;
525
8
    }
526
8
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
7.56k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
7.56k
    } else {
519
7.56k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
7.56k
        ss->id = operator_id();
521
7.56k
        for (auto& dest : dests_id()) {
522
7.56k
            ss->related_op_ids.insert(dest);
523
7.56k
        }
524
7.56k
        return ss;
525
7.56k
    }
526
7.56k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
6
    } else {
519
6
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6
        ss->id = operator_id();
521
6
        for (auto& dest : dests_id()) {
522
6
            ss->related_op_ids.insert(dest);
523
6
        }
524
6
        return ss;
525
6
    }
526
6
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
214k
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
214k
    } else {
519
214k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
214k
        ss->id = operator_id();
521
214k
        for (auto& dest : dests_id()) {
522
214k
            ss->related_op_ids.insert(dest);
523
214k
        }
524
214k
        return ss;
525
214k
    }
526
214k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
34
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
34
    } else {
519
34
        auto ss = LocalStateType::SharedStateType::create_shared();
520
34
        ss->id = operator_id();
521
34
        for (auto& dest : dests_id()) {
522
34
            ss->related_op_ids.insert(dest);
523
34
        }
524
34
        return ss;
525
34
    }
526
34
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
91.5k
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
91.5k
    } else {
519
91.5k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
91.5k
        ss->id = operator_id();
521
91.5k
        for (auto& dest : dests_id()) {
522
91.5k
            ss->related_op_ids.insert(dest);
523
91.5k
        }
524
91.5k
        return ss;
525
91.5k
    }
526
91.5k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
73
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
73
    } else {
519
73
        auto ss = LocalStateType::SharedStateType::create_shared();
520
73
        ss->id = operator_id();
521
73
        for (auto& dest : dests_id()) {
522
73
            ss->related_op_ids.insert(dest);
523
73
        }
524
73
        return ss;
525
73
    }
526
73
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
522k
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
522k
    } else {
519
522k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
522k
        ss->id = operator_id();
521
522k
        for (auto& dest : dests_id()) {
522
514k
            ss->related_op_ids.insert(dest);
523
514k
        }
524
522k
        return ss;
525
522k
    }
526
522k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
8.36k
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.36k
    } else {
519
8.36k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.36k
        ss->id = operator_id();
521
8.37k
        for (auto& dest : dests_id()) {
522
8.37k
            ss->related_op_ids.insert(dest);
523
8.37k
        }
524
8.36k
        return ss;
525
8.36k
    }
526
8.36k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
433
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
433
    } else {
519
433
        auto ss = LocalStateType::SharedStateType::create_shared();
520
433
        ss->id = operator_id();
521
433
        for (auto& dest : dests_id()) {
522
433
            ss->related_op_ids.insert(dest);
523
433
        }
524
433
        return ss;
525
433
    }
526
433
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.61k
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.61k
    } else {
519
2.61k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.61k
        ss->id = operator_id();
521
2.61k
        for (auto& dest : dests_id()) {
522
2.59k
            ss->related_op_ids.insert(dest);
523
2.59k
        }
524
2.61k
        return ss;
525
2.61k
    }
526
2.61k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.51k
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.51k
    } else {
519
2.51k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.51k
        ss->id = operator_id();
521
2.51k
        for (auto& dest : dests_id()) {
522
2.50k
            ss->related_op_ids.insert(dest);
523
2.50k
        }
524
2.51k
        return ss;
525
2.51k
    }
526
2.51k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
561
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
561
    } else {
519
561
        auto ss = LocalStateType::SharedStateType::create_shared();
520
561
        ss->id = operator_id();
521
561
        for (auto& dest : dests_id()) {
522
553
            ss->related_op_ids.insert(dest);
523
553
        }
524
561
        return ss;
525
561
    }
526
561
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
105
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
105
    } else {
519
105
        auto ss = LocalStateType::SharedStateType::create_shared();
520
105
        ss->id = operator_id();
521
105
        for (auto& dest : dests_id()) {
522
105
            ss->related_op_ids.insert(dest);
523
105
        }
524
105
        return ss;
525
105
    }
526
105
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
2.05M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.05M
    auto local_state = LocalStateType::create_unique(state, this);
531
2.05M
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.05M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.05M
    return Status::OK();
534
2.05M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
73.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
73.6k
    auto local_state = LocalStateType::create_unique(state, this);
531
73.6k
    RETURN_IF_ERROR(local_state->init(state, info));
532
73.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
73.6k
    return Status::OK();
534
73.6k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
238k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
238k
    auto local_state = LocalStateType::create_unique(state, this);
531
238k
    RETURN_IF_ERROR(local_state->init(state, info));
532
238k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
238k
    return Status::OK();
534
238k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
133
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
133
    auto local_state = LocalStateType::create_unique(state, this);
531
133
    RETURN_IF_ERROR(local_state->init(state, info));
532
133
    state->emplace_local_state(operator_id(), std::move(local_state));
533
133
    return Status::OK();
534
133
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.08k
    return Status::OK();
534
3.08k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.50k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.50k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.50k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.50k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.50k
    return Status::OK();
534
7.50k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.42k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.42k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.42k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.42k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.42k
    return Status::OK();
534
7.42k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
25
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
25
    auto local_state = LocalStateType::create_unique(state, this);
531
25
    RETURN_IF_ERROR(local_state->init(state, info));
532
25
    state->emplace_local_state(operator_id(), std::move(local_state));
533
25
    return Status::OK();
534
25
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
204k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
204k
    auto local_state = LocalStateType::create_unique(state, this);
531
204k
    RETURN_IF_ERROR(local_state->init(state, info));
532
204k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
204k
    return Status::OK();
534
204k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
91.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
91.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
91.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
91.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
91.0k
    return Status::OK();
534
91.0k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
55.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
55.0k
    auto local_state = LocalStateType::create_unique(state, this);
531
55.0k
    RETURN_IF_ERROR(local_state->init(state, info));
532
55.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
55.0k
    return Status::OK();
534
55.0k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
64
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
64
    auto local_state = LocalStateType::create_unique(state, this);
531
64
    RETURN_IF_ERROR(local_state->init(state, info));
532
64
    state->emplace_local_state(operator_id(), std::move(local_state));
533
64
    return Status::OK();
534
64
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.32k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.32k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.32k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.32k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.32k
    return Status::OK();
534
4.32k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
283k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
283k
    auto local_state = LocalStateType::create_unique(state, this);
531
283k
    RETURN_IF_ERROR(local_state->init(state, info));
532
283k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
283k
    return Status::OK();
534
283k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.54k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.54k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.54k
    return Status::OK();
534
1.54k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.06k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.06k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.06k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.06k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.06k
    return Status::OK();
534
8.06k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
27
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
27
    auto local_state = LocalStateType::create_unique(state, this);
531
27
    RETURN_IF_ERROR(local_state->init(state, info));
532
27
    state->emplace_local_state(operator_id(), std::move(local_state));
533
27
    return Status::OK();
534
27
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
54.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
54.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
54.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54.8k
    return Status::OK();
534
54.8k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.35k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.35k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.35k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.35k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.35k
    return Status::OK();
534
6.35k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
331
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
331
    auto local_state = LocalStateType::create_unique(state, this);
531
331
    RETURN_IF_ERROR(local_state->init(state, info));
532
331
    state->emplace_local_state(operator_id(), std::move(local_state));
533
331
    return Status::OK();
534
331
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.56k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.56k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.56k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.56k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.56k
    return Status::OK();
534
2.56k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.48k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.48k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.48k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.48k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.48k
    return Status::OK();
534
2.48k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
316
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
316
    auto local_state = LocalStateType::create_unique(state, this);
531
316
    RETURN_IF_ERROR(local_state->init(state, info));
532
316
    state->emplace_local_state(operator_id(), std::move(local_state));
533
316
    return Status::OK();
534
316
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.3k
    return Status::OK();
534
10.3k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
659k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
659k
    auto local_state = LocalStateType::create_unique(state, this);
531
659k
    RETURN_IF_ERROR(local_state->init(state, info));
532
659k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
659k
    return Status::OK();
534
659k
}
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
785
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
785
    auto local_state = LocalStateType::create_unique(state, this);
531
785
    RETURN_IF_ERROR(local_state->init(state, info));
532
785
    state->emplace_local_state(operator_id(), std::move(local_state));
533
785
    return Status::OK();
534
785
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
978
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
978
    auto local_state = LocalStateType::create_unique(state, this);
531
978
    RETURN_IF_ERROR(local_state->init(state, info));
532
978
    state->emplace_local_state(operator_id(), std::move(local_state));
533
978
    return Status::OK();
534
978
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.53k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.53k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.53k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.53k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.53k
    return Status::OK();
534
5.53k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
323k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
323k
    auto local_state = LocalStateType::create_unique(state, this);
531
323k
    RETURN_IF_ERROR(local_state->init(state, info));
532
323k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
323k
    return Status::OK();
534
323k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.69M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
2.03M
        : _num_rows_returned(0),
542
2.03M
          _rows_returned_counter(nullptr),
543
2.03M
          _parent(parent),
544
2.03M
          _state(state),
545
2.03M
          _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.18M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
720k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
720k
                                    .first.get()
563
720k
                                    ->template cast<SharedStateArg>();
564
565
720k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
720k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
720k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
720k
        } else if (info.shared_state) {
569
385k
            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
385k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
385k
            _dependency = _shared_state->create_source_dependency(
576
385k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
385k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
385k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
385k
        } else {
580
74.7k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
11.3k
                DCHECK(false);
582
11.3k
            }
583
74.7k
        }
584
1.18M
    }
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
73.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
73.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
73.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
73.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
73.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
73.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
73.8k
    _operator_profile->add_child(_common_profile.get(), true);
557
73.8k
    _operator_profile->add_child(_custom_profile.get(), true);
558
73.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
73.8k
    if constexpr (!is_fake_shared) {
560
73.8k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
12.3k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
12.3k
                                    .first.get()
563
12.3k
                                    ->template cast<SharedStateArg>();
564
565
12.3k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
12.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
12.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
61.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
59.7k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
59.7k
            _dependency = _shared_state->create_source_dependency(
576
59.7k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
59.7k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
59.7k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
59.7k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.81k
        }
584
73.8k
    }
585
586
73.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
73.8k
    _rows_returned_counter =
591
73.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
73.8k
    _blocks_returned_counter =
593
73.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
73.8k
    _output_block_bytes_counter =
595
73.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
73.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
73.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
73.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
73.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
73.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
73.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
73.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
73.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
73.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
73.8k
    _memory_used_counter =
606
73.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
73.8k
    _common_profile->add_info_string("IsColocate",
608
73.8k
                                     std::to_string(_parent->is_colocated_operator()));
609
73.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
73.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
73.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
73.8k
    return Status::OK();
613
73.8k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1
    _operator_profile->add_child(_common_profile.get(), true);
557
1
    _operator_profile->add_child(_custom_profile.get(), true);
558
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1
    if constexpr (!is_fake_shared) {
560
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
1
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
1
            _dependency = _shared_state->create_source_dependency(
576
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
1
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
1
    }
585
586
1
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1
    _rows_returned_counter =
591
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1
    _blocks_returned_counter =
593
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1
    _output_block_bytes_counter =
595
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1
    _memory_used_counter =
606
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1
    _common_profile->add_info_string("IsColocate",
608
1
                                     std::to_string(_parent->is_colocated_operator()));
609
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1
    return Status::OK();
613
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
213k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
213k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
213k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
213k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
213k
    _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
213k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
213k
    _operator_profile->add_child(_common_profile.get(), true);
557
213k
    _operator_profile->add_child(_custom_profile.get(), true);
558
213k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
213k
    if constexpr (!is_fake_shared) {
560
213k
        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
213k
        } 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
204k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
204k
            _dependency = _shared_state->create_source_dependency(
576
204k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
204k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
204k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
204k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
8.80k
        }
584
213k
    }
585
586
213k
    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
213k
    _rows_returned_counter =
591
213k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
213k
    _blocks_returned_counter =
593
213k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
213k
    _output_block_bytes_counter =
595
213k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
213k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
213k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
213k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
213k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
213k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
213k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
213k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
213k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
213k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
213k
    _memory_used_counter =
606
213k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
213k
    _common_profile->add_info_string("IsColocate",
608
213k
                                     std::to_string(_parent->is_colocated_operator()));
609
213k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
213k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
213k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
213k
    return Status::OK();
613
213k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
25
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
25
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
25
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
25
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
25
    _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
25
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
25
    _operator_profile->add_child(_common_profile.get(), true);
557
25
    _operator_profile->add_child(_custom_profile.get(), true);
558
25
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
25
    if constexpr (!is_fake_shared) {
560
25
        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
25
        } 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
25
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
25
            _dependency = _shared_state->create_source_dependency(
576
25
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
25
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
25
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
25
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
25
    }
585
586
25
    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
25
    _rows_returned_counter =
591
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
25
    _blocks_returned_counter =
593
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
25
    _output_block_bytes_counter =
595
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
25
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
25
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
25
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
25
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
25
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
25
    _memory_used_counter =
606
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
25
    _common_profile->add_info_string("IsColocate",
608
25
                                     std::to_string(_parent->is_colocated_operator()));
609
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
25
    return Status::OK();
613
25
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.18k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.18k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.18k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.18k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.18k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
8.18k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.18k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.18k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.18k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.18k
    if constexpr (!is_fake_shared) {
560
8.18k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
8.18k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
7.81k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
7.81k
            _dependency = _shared_state->create_source_dependency(
576
7.81k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
7.81k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
7.81k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
7.81k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
371
        }
584
8.18k
    }
585
586
8.18k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
8.18k
    _rows_returned_counter =
591
8.18k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.18k
    _blocks_returned_counter =
593
8.18k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.18k
    _output_block_bytes_counter =
595
8.18k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.18k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.18k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.18k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.18k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.18k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.18k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.18k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.18k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.18k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.18k
    _memory_used_counter =
606
8.18k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.18k
    _common_profile->add_info_string("IsColocate",
608
8.18k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.18k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.18k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.18k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.18k
    return Status::OK();
613
8.18k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
7.54k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
7.54k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
7.54k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
7.54k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
7.54k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
7.54k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
7.54k
    _operator_profile->add_child(_common_profile.get(), true);
557
7.54k
    _operator_profile->add_child(_custom_profile.get(), true);
558
7.54k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
7.54k
    if constexpr (!is_fake_shared) {
560
7.54k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
7.54k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
7.52k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
7.52k
            _dependency = _shared_state->create_source_dependency(
576
7.52k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
7.52k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
7.52k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
7.52k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
15
        }
584
7.54k
    }
585
586
7.54k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
7.54k
    _rows_returned_counter =
591
7.54k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
7.54k
    _blocks_returned_counter =
593
7.54k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
7.54k
    _output_block_bytes_counter =
595
7.54k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
7.54k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
7.54k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
7.54k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
7.54k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
7.54k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
7.54k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
7.54k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
7.54k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
7.54k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
7.54k
    _memory_used_counter =
606
7.54k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
7.54k
    _common_profile->add_info_string("IsColocate",
608
7.54k
                                     std::to_string(_parent->is_colocated_operator()));
609
7.54k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
7.54k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
7.54k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
7.54k
    return Status::OK();
613
7.54k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
91.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
91.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
91.2k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
91.2k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
91.2k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
91.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
91.2k
    _operator_profile->add_child(_common_profile.get(), true);
557
91.2k
    _operator_profile->add_child(_custom_profile.get(), true);
558
91.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
91.2k
    if constexpr (!is_fake_shared) {
560
91.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
91.2k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
89.4k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
89.4k
            _dependency = _shared_state->create_source_dependency(
576
89.4k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
89.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
89.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
89.4k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.81k
        }
584
91.2k
    }
585
586
91.2k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
91.2k
    _rows_returned_counter =
591
91.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
91.2k
    _blocks_returned_counter =
593
91.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
91.2k
    _output_block_bytes_counter =
595
91.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
91.2k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
91.2k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
91.2k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
91.2k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
91.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
91.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
91.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
91.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
91.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
91.2k
    _memory_used_counter =
606
91.2k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
91.2k
    _common_profile->add_info_string("IsColocate",
608
91.2k
                                     std::to_string(_parent->is_colocated_operator()));
609
91.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
91.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
91.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
91.2k
    return Status::OK();
613
91.2k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
55.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
55.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
55.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
55.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
55.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
55.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
55.0k
    _operator_profile->add_child(_common_profile.get(), true);
557
55.0k
    _operator_profile->add_child(_custom_profile.get(), true);
558
55.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
55.0k
    if constexpr (!is_fake_shared) {
560
55.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
54.9k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
54.9k
                                    .first.get()
563
54.9k
                                    ->template cast<SharedStateArg>();
564
565
54.9k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
54.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
54.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
54.9k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
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
89
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
89
        }
584
55.0k
    }
585
586
55.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
55.0k
    _rows_returned_counter =
591
55.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
55.0k
    _blocks_returned_counter =
593
55.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
55.0k
    _output_block_bytes_counter =
595
55.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
55.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
55.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
55.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
55.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
55.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
55.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
55.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
55.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
55.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
55.0k
    _memory_used_counter =
606
55.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
55.0k
    _common_profile->add_info_string("IsColocate",
608
55.0k
                                     std::to_string(_parent->is_colocated_operator()));
609
55.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
55.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
55.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
55.0k
    return Status::OK();
613
55.0k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
64
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
64
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
64
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
64
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
64
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
64
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
64
    _operator_profile->add_child(_common_profile.get(), true);
557
64
    _operator_profile->add_child(_custom_profile.get(), true);
558
64
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
64
    if constexpr (!is_fake_shared) {
560
64
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
64
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
64
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
64
            _dependency = _shared_state->create_source_dependency(
576
64
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
64
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
64
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
64
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
64
    }
585
586
64
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
64
    _rows_returned_counter =
591
64
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
64
    _blocks_returned_counter =
593
64
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
64
    _output_block_bytes_counter =
595
64
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
64
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
64
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
64
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
64
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
64
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
64
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
64
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
64
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
64
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
64
    _memory_used_counter =
606
64
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
64
    _common_profile->add_info_string("IsColocate",
608
64
                                     std::to_string(_parent->is_colocated_operator()));
609
64
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
64
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
64
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
64
    return Status::OK();
613
64
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
875k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
875k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
875k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
875k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
875k
    _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
875k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
875k
    _operator_profile->add_child(_common_profile.get(), true);
557
875k
    _operator_profile->add_child(_custom_profile.get(), true);
558
875k
    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
875k
    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
875k
    _rows_returned_counter =
591
875k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
875k
    _blocks_returned_counter =
593
875k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
875k
    _output_block_bytes_counter =
595
875k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
875k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
875k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
875k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
875k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
875k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
875k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
875k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
875k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
875k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
875k
    _memory_used_counter =
606
875k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
875k
    _common_profile->add_info_string("IsColocate",
608
875k
                                     std::to_string(_parent->is_colocated_operator()));
609
875k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
875k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
875k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
875k
    return Status::OK();
613
875k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.7k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.7k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.7k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.7k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.7k
    _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.7k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.7k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.7k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.7k
    if constexpr (!is_fake_shared) {
560
54.7k
        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.7k
        } 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.68k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.68k
            _dependency = _shared_state->create_source_dependency(
576
4.68k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.68k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.68k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.0k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
50.0k
        }
584
54.7k
    }
585
586
54.7k
    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.7k
    _rows_returned_counter =
591
54.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.7k
    _blocks_returned_counter =
593
54.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.7k
    _output_block_bytes_counter =
595
54.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.7k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.7k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.7k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.7k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.7k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.7k
    _memory_used_counter =
606
54.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.7k
    _common_profile->add_info_string("IsColocate",
608
54.7k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.7k
    return Status::OK();
613
54.7k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.36k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.36k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.36k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.36k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.36k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
6.36k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.36k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.36k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.36k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.36k
    if constexpr (!is_fake_shared) {
560
6.36k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
6.36k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
6.26k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.26k
            _dependency = _shared_state->create_source_dependency(
576
6.26k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.26k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.26k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.26k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
99
        }
584
6.36k
    }
585
586
6.36k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
6.36k
    _rows_returned_counter =
591
6.36k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.36k
    _blocks_returned_counter =
593
6.36k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.36k
    _output_block_bytes_counter =
595
6.36k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.36k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.36k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.36k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.36k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.36k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.36k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.36k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.36k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.36k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.36k
    _memory_used_counter =
606
6.36k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.36k
    _common_profile->add_info_string("IsColocate",
608
6.36k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.36k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.36k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.36k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.36k
    return Status::OK();
613
6.36k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
433
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
433
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
433
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
433
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
433
    _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
433
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
433
    _operator_profile->add_child(_common_profile.get(), true);
557
433
    _operator_profile->add_child(_custom_profile.get(), true);
558
433
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
433
    if constexpr (!is_fake_shared) {
560
433
        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
433
        } 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
431
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
431
            _dependency = _shared_state->create_source_dependency(
576
431
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
431
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
431
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
431
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
2
        }
584
433
    }
585
586
433
    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
433
    _rows_returned_counter =
591
433
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
433
    _blocks_returned_counter =
593
433
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
433
    _output_block_bytes_counter =
595
433
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
433
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
433
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
433
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
433
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
433
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
433
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
433
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
433
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
433
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
433
    _memory_used_counter =
606
433
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
433
    _common_profile->add_info_string("IsColocate",
608
433
                                     std::to_string(_parent->is_colocated_operator()));
609
433
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
433
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
433
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
433
    return Status::OK();
613
433
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.10k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.10k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.10k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.10k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.10k
    _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.10k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.10k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.10k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.10k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.10k
    if constexpr (!is_fake_shared) {
560
5.10k
        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.10k
        } 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.80k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.80k
            _dependency = _shared_state->create_source_dependency(
576
4.80k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.80k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.80k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.80k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
300
        }
584
5.10k
    }
585
586
5.10k
    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.10k
    _rows_returned_counter =
591
5.10k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.10k
    _blocks_returned_counter =
593
5.10k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.10k
    _output_block_bytes_counter =
595
5.10k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.10k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.10k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.10k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.10k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.10k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.10k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.10k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.10k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.10k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.10k
    _memory_used_counter =
606
5.10k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.10k
    _common_profile->add_info_string("IsColocate",
608
5.10k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.10k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.10k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.10k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.10k
    return Status::OK();
613
5.10k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
664k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
664k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
664k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
664k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
664k
    _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
664k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
664k
    _operator_profile->add_child(_common_profile.get(), true);
557
664k
    _operator_profile->add_child(_custom_profile.get(), true);
558
664k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
664k
    if constexpr (!is_fake_shared) {
560
664k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
653k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
653k
                                    .first.get()
563
653k
                                    ->template cast<SharedStateArg>();
564
565
653k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
653k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
653k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
653k
        } 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
11.3k
        } else {
580
11.3k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
11.3k
                DCHECK(false);
582
11.3k
            }
583
11.3k
        }
584
664k
    }
585
586
664k
    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
664k
    _rows_returned_counter =
591
664k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
664k
    _blocks_returned_counter =
593
664k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
664k
    _output_block_bytes_counter =
595
664k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
664k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
664k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
664k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
664k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
664k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
664k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
664k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
664k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
664k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
664k
    _memory_used_counter =
606
664k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
664k
    _common_profile->add_info_string("IsColocate",
608
664k
                                     std::to_string(_parent->is_colocated_operator()));
609
664k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
664k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
664k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
664k
    return Status::OK();
613
664k
}
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.07M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
2.07M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.36M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
297k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
297k
    }
621
2.07M
    if (_parent->has_projection()) {
622
383k
        const auto& projection = *_parent->_projection;
623
383k
        _projections.resize(projection.projections.size());
624
2.41M
        for (size_t i = 0; i < _projections.size(); i++) {
625
2.03M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
2.03M
        }
627
383k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
401k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
17.3k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
225k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
208k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
208k
                        state, _intermediate_projections[i][j]));
633
208k
            }
634
17.3k
        }
635
383k
    }
636
2.07M
    return Status::OK();
637
2.07M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
75.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
75.0k
    _conjuncts.resize(_parent->_conjuncts.size());
618
77.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
2.06k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
2.06k
    }
621
75.0k
    if (_parent->has_projection()) {
622
75.0k
        const auto& projection = *_parent->_projection;
623
75.0k
        _projections.resize(projection.projections.size());
624
436k
        for (size_t i = 0; i < _projections.size(); i++) {
625
361k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
361k
        }
627
75.0k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
82.5k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.45k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
163k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
155k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
155k
                        state, _intermediate_projections[i][j]));
633
155k
            }
634
7.45k
        }
635
75.0k
    }
636
75.0k
    return Status::OK();
637
75.0k
}
_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
215k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
215k
    _conjuncts.resize(_parent->_conjuncts.size());
618
215k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
215k
    if (_parent->has_projection()) {
622
79
        const auto& projection = *_parent->_projection;
623
79
        _projections.resize(projection.projections.size());
624
400
        for (size_t i = 0; i < _projections.size(); i++) {
625
321
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
321
        }
627
79
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
79
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
79
    }
636
215k
    return Status::OK();
637
215k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_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_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.42k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.42k
    _conjuncts.resize(_parent->_conjuncts.size());
618
8.49k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
77
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
77
    }
621
8.42k
    if (_parent->has_projection()) {
622
8.42k
        const auto& projection = *_parent->_projection;
623
8.42k
        _projections.resize(projection.projections.size());
624
39.9k
        for (size_t i = 0; i < _projections.size(); i++) {
625
31.5k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
31.5k
        }
627
8.42k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
8.47k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
45
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
303
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
258
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
258
                        state, _intermediate_projections[i][j]));
633
258
            }
634
45
        }
635
8.42k
    }
636
8.42k
    return Status::OK();
637
8.42k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
7.57k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
7.57k
    _conjuncts.resize(_parent->_conjuncts.size());
618
8.42k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
854
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
854
    }
621
7.57k
    if (_parent->has_projection()) {
622
4.13k
        const auto& projection = *_parent->_projection;
623
4.13k
        _projections.resize(projection.projections.size());
624
16.8k
        for (size_t i = 0; i < _projections.size(); i++) {
625
12.7k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
12.7k
        }
627
4.13k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.22k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
93
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
704
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
611
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
611
                        state, _intermediate_projections[i][j]));
633
611
            }
634
93
        }
635
4.13k
    }
636
7.57k
    return Status::OK();
637
7.57k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
91.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
91.8k
    _conjuncts.resize(_parent->_conjuncts.size());
618
93.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.39k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.39k
    }
621
91.8k
    if (_parent->has_projection()) {
622
29.5k
        const auto& projection = *_parent->_projection;
623
29.5k
        _projections.resize(projection.projections.size());
624
272k
        for (size_t i = 0; i < _projections.size(); i++) {
625
242k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
242k
        }
627
29.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
29.7k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
174
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
1.17k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
1.00k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
1.00k
                        state, _intermediate_projections[i][j]));
633
1.00k
            }
634
174
        }
635
29.5k
    }
636
91.8k
    return Status::OK();
637
91.8k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
55.1k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
55.1k
    _conjuncts.resize(_parent->_conjuncts.size());
618
55.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
13
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
13
    }
621
55.1k
    if (_parent->has_projection()) {
622
100
        const auto& projection = *_parent->_projection;
623
100
        _projections.resize(projection.projections.size());
624
412
        for (size_t i = 0; i < _projections.size(); i++) {
625
312
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
312
        }
627
100
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
100
        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
100
    }
636
55.1k
    return Status::OK();
637
55.1k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
68
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
68
    _conjuncts.resize(_parent->_conjuncts.size());
618
68
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
68
    if (_parent->has_projection()) {
622
49
        const auto& projection = *_parent->_projection;
623
49
        _projections.resize(projection.projections.size());
624
147
        for (size_t i = 0; i < _projections.size(); i++) {
625
98
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
98
        }
627
49
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
49
        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
49
    }
636
68
    return Status::OK();
637
68
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
881k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
881k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.17M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
292k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
292k
    }
621
881k
    if (_parent->has_projection()) {
622
254k
        const auto& projection = *_parent->_projection;
623
254k
        _projections.resize(projection.projections.size());
624
1.53M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.28M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.28M
        }
627
254k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
264k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
9.43k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
56.4k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
46.9k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
46.9k
                        state, _intermediate_projections[i][j]));
633
46.9k
            }
634
9.43k
        }
635
254k
    }
636
881k
    return Status::OK();
637
881k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
55.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
55.0k
    _conjuncts.resize(_parent->_conjuncts.size());
618
55.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
55.0k
    if (_parent->has_projection()) {
622
11.4k
        const auto& projection = *_parent->_projection;
623
11.4k
        _projections.resize(projection.projections.size());
624
110k
        for (size_t i = 0; i < _projections.size(); i++) {
625
99.0k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
99.0k
        }
627
11.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.6k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
194
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
3.98k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
3.78k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
3.78k
                        state, _intermediate_projections[i][j]));
633
3.78k
            }
634
194
        }
635
11.4k
    }
636
55.0k
    return Status::OK();
637
55.0k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.34k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.34k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.87k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
535
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
535
    }
621
6.34k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
6.34k
    return Status::OK();
637
6.34k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
433
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
433
    _conjuncts.resize(_parent->_conjuncts.size());
618
433
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
433
    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
433
    return Status::OK();
637
433
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.21k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.21k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.21k
    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.21k
    if (_parent->has_projection()) {
622
64
        const auto& projection = *_parent->_projection;
623
64
        _projections.resize(projection.projections.size());
624
243
        for (size_t i = 0; i < _projections.size(); i++) {
625
179
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
179
        }
627
64
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
64
        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
64
    }
636
5.21k
    return Status::OK();
637
5.21k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
669k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
669k
    _conjuncts.resize(_parent->_conjuncts.size());
618
669k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
669k
    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
669k
    return Status::OK();
637
669k
}
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
8.12k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
8.12k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
8.12k
    _terminated = true;
645
8.12k
    return Status::OK();
646
8.12k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
422
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
422
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
422
    _terminated = true;
645
422
    return Status::OK();
646
422
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
19
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
19
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
19
    _terminated = true;
645
19
    return Status::OK();
646
19
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
39
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
39
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
39
    _terminated = true;
645
39
    return Status::OK();
646
39
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_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_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
26
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
26
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
26
    _terminated = true;
645
26
    return Status::OK();
646
26
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
6.05k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.05k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.05k
    _terminated = true;
645
6.05k
    return Status::OK();
646
6.05k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
34
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
34
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
34
    _terminated = true;
645
34
    return Status::OK();
646
34
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
181
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
181
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
181
    _terminated = true;
645
181
    return Status::OK();
646
181
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.31k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.31k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1.31k
    _terminated = true;
645
1.31k
    return Status::OK();
646
1.31k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
31
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
31
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
31
    _terminated = true;
645
31
    return Status::OK();
646
31
}
647
648
template <typename SharedStateArg>
649
2.31M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.31M
    if (_closed) {
651
243k
        return Status::OK();
652
243k
    }
653
2.07M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.18M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.18M
    }
656
2.07M
    _closed = true;
657
2.07M
    return Status::OK();
658
2.31M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
75.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
75.0k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
75.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
75.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
75.0k
    }
656
75.0k
    _closed = true;
657
75.0k
    return Status::OK();
658
75.0k
}
_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
425k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
425k
    if (_closed) {
651
213k
        return Status::OK();
652
213k
    }
653
211k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
211k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
211k
    }
656
211k
    _closed = true;
657
211k
    return Status::OK();
658
425k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
25
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
25
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
25
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
25
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
25
    }
656
25
    _closed = true;
657
25
    return Status::OK();
658
25
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
8.41k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
8.41k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
8.41k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.41k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.41k
    }
656
8.41k
    _closed = true;
657
8.41k
    return Status::OK();
658
8.41k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
15.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
15.2k
    if (_closed) {
651
7.70k
        return Status::OK();
652
7.70k
    }
653
7.55k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
7.55k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
7.55k
    }
656
7.55k
    _closed = true;
657
7.55k
    return Status::OK();
658
15.2k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
91.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
91.6k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
91.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
91.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
91.6k
    }
656
91.6k
    _closed = true;
657
91.6k
    return Status::OK();
658
91.6k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
54.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
54.9k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
54.9k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
54.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
54.9k
    }
656
54.9k
    _closed = true;
657
54.9k
    return Status::OK();
658
54.9k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
63
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
63
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
63
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
63
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
63
    }
656
63
    _closed = true;
657
63
    return Status::OK();
658
63
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
897k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
897k
    if (_closed) {
651
15.8k
        return Status::OK();
652
15.8k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
882k
    _closed = true;
657
882k
    return Status::OK();
658
897k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
55.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
55.0k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
55.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
55.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
55.0k
    }
656
55.0k
    _closed = true;
657
55.0k
    return Status::OK();
658
55.0k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
27
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
27
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
13
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
13
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
13
    }
656
13
    _closed = true;
657
13
    return Status::OK();
658
27
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.34k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.34k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.34k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.34k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.34k
    }
656
6.34k
    _closed = true;
657
6.34k
    return Status::OK();
658
6.34k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
661
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
661
    if (_closed) {
651
331
        return Status::OK();
652
331
    }
653
330
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
330
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
330
    }
656
330
    _closed = true;
657
330
    return Status::OK();
658
661
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.7k
    if (_closed) {
651
5.52k
        return Status::OK();
652
5.52k
    }
653
5.20k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.20k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.20k
    }
656
5.20k
    _closed = true;
657
5.20k
    return Status::OK();
658
10.7k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
671k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
671k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
671k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
671k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
671k
    }
656
671k
    _closed = true;
657
671k
    return Status::OK();
658
671k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
339
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
339
    if (_closed) {
651
179
        return Status::OK();
652
179
    }
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
339
}
659
660
template <typename SharedState>
661
1.70M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.70M
    _operator_profile =
664
1.70M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.70M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.70M
    _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.70M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.70M
    _operator_profile->add_child(_common_profile, true);
673
1.70M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.70M
    _operator_profile->set_metadata(_parent->node_id());
676
1.70M
    _wait_for_finish_dependency_timer =
677
1.70M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.70M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.70M
    if constexpr (!is_fake_shared) {
680
1.18M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.18M
            info.shared_state_map.end()) {
682
314k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
246k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
246k
            }
685
314k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
314k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
314k
                                                  ? 0
688
314k
                                                  : info.task_idx]
689
314k
                                  .get();
690
314k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
871k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
871k
            _shared_state = info.shared_state->template cast<SharedState>();
696
871k
            _dependency = _shared_state->create_sink_dependency(
697
871k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
871k
        }
699
1.18M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.18M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.18M
    }
702
703
1.70M
    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.70M
    _rows_input_counter =
708
1.70M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.70M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.70M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.70M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.70M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.70M
    _memory_used_counter =
714
1.70M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.70M
    _common_profile->add_info_string("IsColocate",
716
1.70M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.70M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.70M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.70M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.70M
    return Status::OK();
721
1.70M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
122k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
122k
    _operator_profile =
664
122k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
122k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
122k
    _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
122k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
122k
    _operator_profile->add_child(_common_profile, true);
673
122k
    _operator_profile->add_child(_custom_profile, true);
674
675
122k
    _operator_profile->set_metadata(_parent->node_id());
676
122k
    _wait_for_finish_dependency_timer =
677
122k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
122k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
122k
    if constexpr (!is_fake_shared) {
680
122k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
122k
            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.5k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
12.5k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
12.5k
                                                  ? 0
688
12.5k
                                                  : info.task_idx]
689
12.5k
                                  .get();
690
12.5k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
110k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
110k
            _shared_state = info.shared_state->template cast<SharedState>();
696
110k
            _dependency = _shared_state->create_sink_dependency(
697
110k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
110k
        }
699
122k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
122k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
122k
    }
702
703
122k
    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
122k
    _rows_input_counter =
708
122k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
122k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
122k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
122k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
122k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
122k
    _memory_used_counter =
714
122k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
122k
    _common_profile->add_info_string("IsColocate",
716
122k
                                     std::to_string(_parent->is_colocated_operator()));
717
122k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
122k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
122k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
122k
    return Status::OK();
721
122k
}
_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
213k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
213k
    _operator_profile =
664
213k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
213k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
213k
    _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
213k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
213k
    _operator_profile->add_child(_common_profile, true);
673
213k
    _operator_profile->add_child(_custom_profile, true);
674
675
213k
    _operator_profile->set_metadata(_parent->node_id());
676
213k
    _wait_for_finish_dependency_timer =
677
213k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
213k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
213k
    if constexpr (!is_fake_shared) {
680
213k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
213k
            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
213k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
213k
            _shared_state = info.shared_state->template cast<SharedState>();
696
213k
            _dependency = _shared_state->create_sink_dependency(
697
213k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
213k
        }
699
213k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
213k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
213k
    }
702
703
213k
    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
213k
    _rows_input_counter =
708
213k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
213k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
213k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
213k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
213k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
213k
    _memory_used_counter =
714
213k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
213k
    _common_profile->add_info_string("IsColocate",
716
213k
                                     std::to_string(_parent->is_colocated_operator()));
717
213k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
213k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
213k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
213k
    return Status::OK();
721
213k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
32
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
32
    _operator_profile =
664
32
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
32
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
32
    _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
32
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
32
    _operator_profile->add_child(_common_profile, true);
673
32
    _operator_profile->add_child(_custom_profile, true);
674
675
32
    _operator_profile->set_metadata(_parent->node_id());
676
32
    _wait_for_finish_dependency_timer =
677
32
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
32
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
32
    if constexpr (!is_fake_shared) {
680
32
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
32
            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
32
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
32
            _shared_state = info.shared_state->template cast<SharedState>();
696
32
            _dependency = _shared_state->create_sink_dependency(
697
32
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
32
        }
699
32
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
32
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
32
    }
702
703
32
    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
32
    _rows_input_counter =
708
32
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
32
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
32
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
32
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
32
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
32
    _memory_used_counter =
714
32
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
32
    _common_profile->add_info_string("IsColocate",
716
32
                                     std::to_string(_parent->is_colocated_operator()));
717
32
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
32
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
32
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
32
    return Status::OK();
721
32
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.32k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.32k
    _operator_profile =
664
8.32k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.32k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.32k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.32k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.32k
    _operator_profile->add_child(_common_profile, true);
673
8.32k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.32k
    _operator_profile->set_metadata(_parent->node_id());
676
8.32k
    _wait_for_finish_dependency_timer =
677
8.32k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.32k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.32k
    if constexpr (!is_fake_shared) {
680
8.32k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.32k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.32k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.32k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.32k
            _dependency = _shared_state->create_sink_dependency(
697
8.32k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.32k
        }
699
8.32k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.32k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.32k
    }
702
703
8.32k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.32k
    _rows_input_counter =
708
8.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.32k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.32k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.32k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.32k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.32k
    _memory_used_counter =
714
8.32k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.32k
    _common_profile->add_info_string("IsColocate",
716
8.32k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.32k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.32k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.32k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.32k
    return Status::OK();
721
8.32k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
7.55k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
7.55k
    _operator_profile =
664
7.55k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
7.55k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
7.55k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
7.55k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
7.55k
    _operator_profile->add_child(_common_profile, true);
673
7.55k
    _operator_profile->add_child(_custom_profile, true);
674
675
7.55k
    _operator_profile->set_metadata(_parent->node_id());
676
7.55k
    _wait_for_finish_dependency_timer =
677
7.55k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
7.55k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
7.55k
    if constexpr (!is_fake_shared) {
680
7.55k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
7.55k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
7.55k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
7.55k
            _shared_state = info.shared_state->template cast<SharedState>();
696
7.55k
            _dependency = _shared_state->create_sink_dependency(
697
7.55k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
7.55k
        }
699
7.55k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
7.55k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
7.55k
    }
702
703
7.55k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
7.55k
    _rows_input_counter =
708
7.55k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
7.55k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
7.55k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
7.55k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
7.55k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
7.55k
    _memory_used_counter =
714
7.55k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
7.55k
    _common_profile->add_info_string("IsColocate",
716
7.55k
                                     std::to_string(_parent->is_colocated_operator()));
717
7.55k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
7.55k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
7.55k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
7.55k
    return Status::OK();
721
7.55k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
91.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
91.4k
    _operator_profile =
664
91.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
91.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
91.4k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
91.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
91.4k
    _operator_profile->add_child(_common_profile, true);
673
91.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
91.4k
    _operator_profile->set_metadata(_parent->node_id());
676
91.4k
    _wait_for_finish_dependency_timer =
677
91.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
91.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
91.4k
    if constexpr (!is_fake_shared) {
680
91.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
91.4k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
91.4k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
91.4k
            _shared_state = info.shared_state->template cast<SharedState>();
696
91.4k
            _dependency = _shared_state->create_sink_dependency(
697
91.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
91.4k
        }
699
91.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
91.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
91.4k
    }
702
703
91.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
91.4k
    _rows_input_counter =
708
91.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
91.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
91.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
91.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
91.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
91.4k
    _memory_used_counter =
714
91.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
91.4k
    _common_profile->add_info_string("IsColocate",
716
91.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
91.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
91.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
91.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
91.4k
    return Status::OK();
721
91.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
55.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
55.0k
    _operator_profile =
664
55.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
55.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
55.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
55.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
55.0k
    _operator_profile->add_child(_common_profile, true);
673
55.0k
    _operator_profile->add_child(_custom_profile, true);
674
675
55.0k
    _operator_profile->set_metadata(_parent->node_id());
676
55.0k
    _wait_for_finish_dependency_timer =
677
55.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
55.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
55.0k
    if constexpr (!is_fake_shared) {
680
55.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
55.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
55.0k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
55.0k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
55.0k
                                                  ? 0
688
55.0k
                                                  : info.task_idx]
689
55.0k
                                  .get();
690
55.0k
            _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
55.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
55.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
55.0k
    }
702
703
55.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
55.0k
    _rows_input_counter =
708
55.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
55.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
55.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
55.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
55.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
55.0k
    _memory_used_counter =
714
55.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
55.0k
    _common_profile->add_info_string("IsColocate",
716
55.0k
                                     std::to_string(_parent->is_colocated_operator()));
717
55.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
55.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
55.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
55.0k
    return Status::OK();
721
55.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
74
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
74
    _operator_profile =
664
74
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
74
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
74
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
74
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
74
    _operator_profile->add_child(_common_profile, true);
673
74
    _operator_profile->add_child(_custom_profile, true);
674
675
74
    _operator_profile->set_metadata(_parent->node_id());
676
74
    _wait_for_finish_dependency_timer =
677
74
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
74
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
74
    if constexpr (!is_fake_shared) {
680
74
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
74
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
74
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
74
            _shared_state = info.shared_state->template cast<SharedState>();
696
74
            _dependency = _shared_state->create_sink_dependency(
697
74
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
74
        }
699
74
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
74
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
74
    }
702
703
74
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
74
    _rows_input_counter =
708
74
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
74
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
74
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
74
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
74
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
74
    _memory_used_counter =
714
74
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
74
    _common_profile->add_info_string("IsColocate",
716
74
                                     std::to_string(_parent->is_colocated_operator()));
717
74
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
74
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
74
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
74
    return Status::OK();
721
74
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
522k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
522k
    _operator_profile =
664
522k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
522k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
522k
    _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
522k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
522k
    _operator_profile->add_child(_common_profile, true);
673
522k
    _operator_profile->add_child(_custom_profile, true);
674
675
522k
    _operator_profile->set_metadata(_parent->node_id());
676
522k
    _wait_for_finish_dependency_timer =
677
522k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
522k
    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
522k
    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
522k
    _rows_input_counter =
708
522k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
522k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
522k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
522k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
522k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
522k
    _memory_used_counter =
714
522k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
522k
    _common_profile->add_info_string("IsColocate",
716
522k
                                     std::to_string(_parent->is_colocated_operator()));
717
522k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
522k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
522k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
522k
    return Status::OK();
721
522k
}
_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
433
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
433
    _operator_profile =
664
433
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
433
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
433
    _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
433
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
433
    _operator_profile->add_child(_common_profile, true);
673
433
    _operator_profile->add_child(_custom_profile, true);
674
675
433
    _operator_profile->set_metadata(_parent->node_id());
676
433
    _wait_for_finish_dependency_timer =
677
433
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
433
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
433
    if constexpr (!is_fake_shared) {
680
433
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
433
            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
433
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
433
            _shared_state = info.shared_state->template cast<SharedState>();
696
433
            _dependency = _shared_state->create_sink_dependency(
697
433
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
433
        }
699
433
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
433
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
433
    }
702
703
433
    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
433
    _rows_input_counter =
708
433
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
433
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
433
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
433
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
433
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
433
    _memory_used_counter =
714
433
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
433
    _common_profile->add_info_string("IsColocate",
716
433
                                     std::to_string(_parent->is_colocated_operator()));
717
433
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
433
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
433
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
433
    return Status::OK();
721
433
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.51k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.51k
    _operator_profile =
664
2.51k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.51k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.51k
    _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.51k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.51k
    _operator_profile->add_child(_common_profile, true);
673
2.51k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.51k
    _operator_profile->set_metadata(_parent->node_id());
676
2.51k
    _wait_for_finish_dependency_timer =
677
2.51k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.51k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.51k
    if constexpr (!is_fake_shared) {
680
2.51k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.51k
            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.51k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.51k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.51k
            _dependency = _shared_state->create_sink_dependency(
697
2.51k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.51k
        }
699
2.51k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.51k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.51k
    }
702
703
2.51k
    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.51k
    _rows_input_counter =
708
2.51k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.51k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.51k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.51k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.51k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.51k
    _memory_used_counter =
714
2.51k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.51k
    _common_profile->add_info_string("IsColocate",
716
2.51k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.51k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.51k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.51k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.51k
    return Status::OK();
721
2.51k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.6k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.6k
    _operator_profile =
664
12.6k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.6k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.6k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.6k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.6k
    _operator_profile->add_child(_common_profile, true);
673
12.6k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.6k
    _operator_profile->set_metadata(_parent->node_id());
676
12.6k
    _wait_for_finish_dependency_timer =
677
12.6k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.6k
    if constexpr (!is_fake_shared) {
680
12.6k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.6k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.6k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.6k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.6k
            _dependency = _shared_state->create_sink_dependency(
697
12.6k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.6k
        }
699
12.6k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.6k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.6k
    }
702
703
12.6k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.6k
    _rows_input_counter =
708
12.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.6k
    _memory_used_counter =
714
12.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.6k
    _common_profile->add_info_string("IsColocate",
716
12.6k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.6k
    return Status::OK();
721
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
246k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
246k
    _operator_profile =
664
246k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
246k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
246k
    _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
246k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
246k
    _operator_profile->add_child(_common_profile, true);
673
246k
    _operator_profile->add_child(_custom_profile, true);
674
675
246k
    _operator_profile->set_metadata(_parent->node_id());
676
246k
    _wait_for_finish_dependency_timer =
677
246k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
246k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
246k
    if constexpr (!is_fake_shared) {
680
246k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
246k
            info.shared_state_map.end()) {
682
246k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
246k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
246k
            }
685
246k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
246k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
246k
                                                  ? 0
688
246k
                                                  : info.task_idx]
689
246k
                                  .get();
690
246k
            _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
246k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
246k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
246k
    }
702
703
246k
    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
246k
    _rows_input_counter =
708
246k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
246k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
246k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
246k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
246k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
246k
    _memory_used_counter =
714
246k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
246k
    _common_profile->add_info_string("IsColocate",
716
246k
                                     std::to_string(_parent->is_colocated_operator()));
717
246k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
246k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
246k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
246k
    return Status::OK();
721
246k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
414k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
414k
    _operator_profile =
664
414k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
414k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
414k
    _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
414k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
414k
    _operator_profile->add_child(_common_profile, true);
673
414k
    _operator_profile->add_child(_custom_profile, true);
674
675
414k
    _operator_profile->set_metadata(_parent->node_id());
676
414k
    _wait_for_finish_dependency_timer =
677
414k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
414k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
414k
    if constexpr (!is_fake_shared) {
680
414k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
414k
            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
414k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
414k
            _shared_state = info.shared_state->template cast<SharedState>();
696
414k
            _dependency = _shared_state->create_sink_dependency(
697
414k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
414k
        }
699
414k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
414k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
414k
    }
702
703
414k
    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
414k
    _rows_input_counter =
708
414k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
414k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
414k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
414k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
414k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
414k
    _memory_used_counter =
714
414k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
414k
    _common_profile->add_info_string("IsColocate",
716
414k
                                     std::to_string(_parent->is_colocated_operator()));
717
414k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
414k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
414k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
414k
    return Status::OK();
721
414k
}
_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.71M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.71M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.71M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.18M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.18M
    }
731
1.71M
    _closed = true;
732
1.71M
    return Status::OK();
733
1.71M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
122k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
122k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
122k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
122k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
122k
    }
731
122k
    _closed = true;
732
122k
    return Status::OK();
733
122k
}
_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
213k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
213k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
213k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
213k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
213k
    }
731
213k
    _closed = true;
732
213k
    return Status::OK();
733
213k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
23
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
23
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
21
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
21
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
21
    }
731
21
    _closed = true;
732
21
    return Status::OK();
733
23
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.33k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.33k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.33k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.33k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.33k
    }
731
8.33k
    _closed = true;
732
8.33k
    return Status::OK();
733
8.33k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
7.54k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
7.54k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
7.54k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
7.54k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
7.54k
    }
731
7.54k
    _closed = true;
732
7.54k
    return Status::OK();
733
7.54k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
91.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
91.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
91.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
91.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
91.4k
    }
731
91.4k
    _closed = true;
732
91.4k
    return Status::OK();
733
91.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
54.7k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
54.7k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
54.7k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
54.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
54.7k
    }
731
54.7k
    _closed = true;
732
54.7k
    return Status::OK();
733
54.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
63
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
63
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
63
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
63
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
63
    }
731
63
    _closed = true;
732
63
    return Status::OK();
733
63
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
527k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
527k
    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
527k
    _closed = true;
732
527k
    return Status::OK();
733
527k
}
_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
329
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
329
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
329
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
329
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
329
    }
731
329
    _closed = true;
732
329
    return Status::OK();
733
329
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.55k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.55k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.55k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.55k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.55k
    }
731
2.55k
    _closed = true;
732
2.55k
    return Status::OK();
733
2.55k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.6k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.6k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.6k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.6k
    }
731
12.6k
    _closed = true;
732
12.6k
    return Status::OK();
733
12.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
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_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
416k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
416k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
416k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
416k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
416k
    }
731
416k
    _closed = true;
732
416k
    return Status::OK();
733
416k
}
_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.83k
                                                          bool* eos) {
738
4.83k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.83k
    return pull(state, block, eos);
740
4.83k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
38
                                                          bool* eos) {
738
38
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
38
    return pull(state, block, eos);
740
38
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.80k
                                                          bool* eos) {
738
4.80k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.79k
    return pull(state, block, eos);
740
4.80k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
564k
                                                         bool* eos) {
745
564k
    auto& local_state = get_local_state(state);
746
564k
    if (need_more_input_data(state)) {
747
534k
        local_state._child_block->clear_column_data(
748
534k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
534k
                        .num_materialized_slots());
750
534k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
534k
                state, local_state._child_block.get(), &local_state._child_eos));
752
534k
        *eos = local_state._child_eos;
753
534k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
62.1k
            return Status::OK();
755
62.1k
        }
756
471k
        {
757
471k
            SCOPED_TIMER(local_state.exec_time_counter());
758
471k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
471k
        }
760
471k
    }
761
762
502k
    if (!need_more_input_data(state)) {
763
472k
        SCOPED_TIMER(local_state.exec_time_counter());
764
472k
        bool new_eos = false;
765
472k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
472k
        if (new_eos) {
767
395k
            *eos = true;
768
395k
        } else if (!need_more_input_data(state)) {
769
23.2k
            *eos = false;
770
23.2k
        }
771
472k
    }
772
502k
    return Status::OK();
773
502k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
142k
                                                         bool* eos) {
745
142k
    auto& local_state = get_local_state(state);
746
142k
    if (need_more_input_data(state)) {
747
124k
        local_state._child_block->clear_column_data(
748
124k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
124k
                        .num_materialized_slots());
750
124k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
124k
                state, local_state._child_block.get(), &local_state._child_eos));
752
124k
        *eos = local_state._child_eos;
753
124k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
35.3k
            return Status::OK();
755
35.3k
        }
756
89.1k
        {
757
89.1k
            SCOPED_TIMER(local_state.exec_time_counter());
758
89.1k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
89.1k
        }
760
89.1k
    }
761
762
106k
    if (!need_more_input_data(state)) {
763
106k
        SCOPED_TIMER(local_state.exec_time_counter());
764
106k
        bool new_eos = false;
765
106k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
106k
        if (new_eos) {
767
50.6k
            *eos = true;
768
56.2k
        } else if (!need_more_input_data(state)) {
769
9.18k
            *eos = false;
770
9.18k
        }
771
106k
    }
772
106k
    return Status::OK();
773
106k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.35k
                                                         bool* eos) {
745
4.35k
    auto& local_state = get_local_state(state);
746
4.35k
    if (need_more_input_data(state)) {
747
2.38k
        local_state._child_block->clear_column_data(
748
2.38k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.38k
                        .num_materialized_slots());
750
2.38k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.38k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.38k
        *eos = local_state._child_eos;
753
2.38k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
303
            return Status::OK();
755
303
        }
756
2.08k
        {
757
2.08k
            SCOPED_TIMER(local_state.exec_time_counter());
758
2.08k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
2.08k
        }
760
2.08k
    }
761
762
4.07k
    if (!need_more_input_data(state)) {
763
4.07k
        SCOPED_TIMER(local_state.exec_time_counter());
764
4.07k
        bool new_eos = false;
765
4.07k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
4.07k
        if (new_eos) {
767
1.55k
            *eos = true;
768
2.51k
        } else if (!need_more_input_data(state)) {
769
1.95k
            *eos = false;
770
1.95k
        }
771
4.07k
    }
772
4.05k
    return Status::OK();
773
4.05k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.84k
                                                         bool* eos) {
745
1.84k
    auto& local_state = get_local_state(state);
746
1.84k
    if (need_more_input_data(state)) {
747
1.84k
        local_state._child_block->clear_column_data(
748
1.84k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.84k
                        .num_materialized_slots());
750
1.84k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.84k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.84k
        *eos = local_state._child_eos;
753
1.84k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
774
            return Status::OK();
755
774
        }
756
1.06k
        {
757
1.06k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.06k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.06k
        }
760
1.06k
    }
761
762
1.06k
    if (!need_more_input_data(state)) {
763
1.06k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.06k
        bool new_eos = false;
765
1.06k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.06k
        if (new_eos) {
767
785
            *eos = true;
768
785
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.06k
    }
772
1.06k
    return Status::OK();
773
1.06k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
15.8k
                                                         bool* eos) {
745
15.8k
    auto& local_state = get_local_state(state);
746
15.8k
    if (need_more_input_data(state)) {
747
15.8k
        local_state._child_block->clear_column_data(
748
15.8k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
15.8k
                        .num_materialized_slots());
750
15.8k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
15.8k
                state, local_state._child_block.get(), &local_state._child_eos));
752
15.8k
        *eos = local_state._child_eos;
753
15.8k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
3.30k
            return Status::OK();
755
3.30k
        }
756
12.5k
        {
757
12.5k
            SCOPED_TIMER(local_state.exec_time_counter());
758
12.5k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
12.5k
        }
760
12.5k
    }
761
762
12.5k
    if (!need_more_input_data(state)) {
763
5.55k
        SCOPED_TIMER(local_state.exec_time_counter());
764
5.55k
        bool new_eos = false;
765
5.55k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
5.55k
        if (new_eos) {
767
5.51k
            *eos = true;
768
5.51k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
5.55k
    }
772
12.5k
    return Status::OK();
773
12.5k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
368k
                                                         bool* eos) {
745
368k
    auto& local_state = get_local_state(state);
746
368k
    if (need_more_input_data(state)) {
747
368k
        local_state._child_block->clear_column_data(
748
368k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
368k
                        .num_materialized_slots());
750
368k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
368k
                state, local_state._child_block.get(), &local_state._child_eos));
752
368k
        *eos = local_state._child_eos;
753
368k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
20.8k
            return Status::OK();
755
20.8k
        }
756
348k
        {
757
348k
            SCOPED_TIMER(local_state.exec_time_counter());
758
348k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
348k
        }
760
348k
    }
761
762
347k
    if (!need_more_input_data(state)) {
763
325k
        SCOPED_TIMER(local_state.exec_time_counter());
764
325k
        bool new_eos = false;
765
325k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
325k
        if (new_eos) {
767
324k
            *eos = true;
768
324k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
325k
    }
772
347k
    return Status::OK();
773
347k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
25.4k
                                                         bool* eos) {
745
25.4k
    auto& local_state = get_local_state(state);
746
25.4k
    if (need_more_input_data(state)) {
747
13.7k
        local_state._child_block->clear_column_data(
748
13.7k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
13.7k
                        .num_materialized_slots());
750
13.7k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
13.7k
                state, local_state._child_block.get(), &local_state._child_eos));
752
13.7k
        *eos = local_state._child_eos;
753
13.7k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
651
            return Status::OK();
755
651
        }
756
13.0k
        {
757
13.0k
            SCOPED_TIMER(local_state.exec_time_counter());
758
13.0k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
13.0k
        }
760
13.0k
    }
761
762
24.7k
    if (!need_more_input_data(state)) {
763
24.0k
        SCOPED_TIMER(local_state.exec_time_counter());
764
24.0k
        bool new_eos = false;
765
24.0k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
24.0k
        if (new_eos) {
767
8.37k
            *eos = true;
768
15.7k
        } else if (!need_more_input_data(state)) {
769
11.7k
            *eos = false;
770
11.7k
        }
771
24.0k
    }
772
24.7k
    return Status::OK();
773
24.7k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
7.11k
                                                         bool* eos) {
745
7.11k
    auto& local_state = get_local_state(state);
746
7.11k
    if (need_more_input_data(state)) {
747
6.75k
        local_state._child_block->clear_column_data(
748
6.75k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
6.75k
                        .num_materialized_slots());
750
6.75k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
6.75k
                state, local_state._child_block.get(), &local_state._child_eos));
752
6.75k
        *eos = local_state._child_eos;
753
6.75k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
857
            return Status::OK();
755
857
        }
756
5.89k
        {
757
5.89k
            SCOPED_TIMER(local_state.exec_time_counter());
758
5.89k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
5.89k
        }
760
5.89k
    }
761
762
6.26k
    if (!need_more_input_data(state)) {
763
6.26k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.26k
        bool new_eos = false;
765
6.26k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.26k
        if (new_eos) {
767
4.27k
            *eos = true;
768
4.27k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
6.26k
    }
772
6.25k
    return Status::OK();
773
6.25k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
46.6k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
46.6k
    RETURN_IF_ERROR(Base::init(state, info));
779
46.6k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
46.6k
                                                         "AsyncWriterDependency", true);
781
46.6k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
46.6k
                             _finish_dependency));
783
784
46.6k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
46.6k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
46.6k
    return Status::OK();
787
46.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
362
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
362
    RETURN_IF_ERROR(Base::init(state, info));
779
362
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
362
                                                         "AsyncWriterDependency", true);
781
362
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
362
                             _finish_dependency));
783
784
362
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
362
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
362
    return Status::OK();
787
362
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
46.2k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
46.2k
    RETURN_IF_ERROR(Base::init(state, info));
779
46.2k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
46.2k
                                                         "AsyncWriterDependency", true);
781
46.2k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
46.2k
                             _finish_dependency));
783
784
46.2k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
46.2k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
46.2k
    return Status::OK();
787
46.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
47.3k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.3k
    RETURN_IF_ERROR(Base::open(state));
793
47.3k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
367k
    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.3k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.3k
    return Status::OK();
800
47.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
362
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
362
    RETURN_IF_ERROR(Base::open(state));
793
362
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.86k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.50k
        RETURN_IF_ERROR(
796
1.50k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.50k
    }
798
362
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
362
    return Status::OK();
800
362
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
46.9k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
46.9k
    RETURN_IF_ERROR(Base::open(state));
793
46.9k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
365k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
318k
        RETURN_IF_ERROR(
796
318k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
318k
    }
798
46.9k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
46.9k
    return Status::OK();
800
46.9k
}
_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.5k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
63.5k
    return _writer->sink(block, eos);
806
63.5k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.64k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.64k
    return _writer->sink(block, eos);
806
1.64k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
61.8k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
61.8k
    return _writer->sink(block, eos);
806
61.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
8
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
8
    return _writer->sink(block, eos);
806
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
47.4k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.4k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.4k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.4k
    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.4k
    if (_writer) {
818
47.4k
        Status st = _writer->get_writer_status();
819
47.4k
        if (exec_status.ok()) {
820
47.4k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.4k
                                                       : Status::Cancelled("force close"));
822
47.4k
        } else {
823
51
            _writer->force_close(exec_status);
824
51
        }
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.4k
        RETURN_IF_ERROR(st);
829
47.4k
    }
830
47.3k
    return Base::close(state, exec_status);
831
47.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
350
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
350
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
350
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
350
    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
350
    if (_writer) {
818
350
        Status st = _writer->get_writer_status();
819
350
        if (exec_status.ok()) {
820
350
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
350
                                                       : Status::Cancelled("force close"));
822
350
        } 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
350
        RETURN_IF_ERROR(st);
829
350
    }
830
350
    return Base::close(state, exec_status);
831
350
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
47.0k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.0k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.0k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.0k
    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.1k
    if (_writer) {
818
47.1k
        Status st = _writer->get_writer_status();
819
47.1k
        if (exec_status.ok()) {
820
47.0k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.0k
                                                       : Status::Cancelled("force close"));
822
47.0k
        } else {
823
51
            _writer->force_close(exec_status);
824
51
        }
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.1k
        RETURN_IF_ERROR(st);
829
47.1k
    }
830
47.0k
    return Base::close(state, exec_status);
831
47.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
8
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
8
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
8
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
8
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
8
    if (_writer) {
818
8
        Status st = _writer->get_writer_status();
819
8
        if (exec_status.ok()) {
820
8
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
8
                                                       : Status::Cancelled("force close"));
822
8
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
8
        RETURN_IF_ERROR(st);
829
8
    }
830
8
    return Base::close(state, exec_status);
831
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
832
833
// An instantiation added outside the macros below needs the matching
834
// 'extern template' declaration in the operator's header (enforced by
835
// build-support/check-extern-template-pairing.py). Instantiations expanded
836
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
837
// skipped -- so their extern pairing has to be kept in sync by hand.
838
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
839
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
840
DECLARE_OPERATOR(ResultSinkLocalState)
841
DECLARE_OPERATOR(JdbcTableSinkLocalState)
842
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
843
DECLARE_OPERATOR(ResultFileSinkLocalState)
844
DECLARE_OPERATOR(OlapTableSinkLocalState)
845
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
846
DECLARE_OPERATOR(HiveTableSinkLocalState)
847
DECLARE_OPERATOR(TVFTableSinkLocalState)
848
DECLARE_OPERATOR(IcebergTableSinkLocalState)
849
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
850
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
851
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
852
DECLARE_OPERATOR(MCTableSinkLocalState)
853
DECLARE_OPERATOR(AnalyticSinkLocalState)
854
DECLARE_OPERATOR(BlackholeSinkLocalState)
855
DECLARE_OPERATOR(SortSinkLocalState)
856
DECLARE_OPERATOR(SpillSortSinkLocalState)
857
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
858
DECLARE_OPERATOR(AggSinkLocalState)
859
DECLARE_OPERATOR(BucketedAggSinkLocalState)
860
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
861
DECLARE_OPERATOR(ExchangeSinkLocalState)
862
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
863
DECLARE_OPERATOR(UnionSinkLocalState)
864
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
865
DECLARE_OPERATOR(PartitionSortSinkLocalState)
866
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
867
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
868
DECLARE_OPERATOR(SetSinkLocalState<true>)
869
DECLARE_OPERATOR(SetSinkLocalState<false>)
870
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
871
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
872
DECLARE_OPERATOR(CacheSinkLocalState)
873
DECLARE_OPERATOR(DictSinkLocalState)
874
DECLARE_OPERATOR(RecCTESinkLocalState)
875
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
876
877
#undef DECLARE_OPERATOR
878
879
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
880
DECLARE_OPERATOR(HashJoinProbeLocalState)
881
DECLARE_OPERATOR(OlapScanLocalState)
882
DECLARE_OPERATOR(GroupCommitLocalState)
883
DECLARE_OPERATOR(JDBCScanLocalState)
884
DECLARE_OPERATOR(FileScanLocalState)
885
DECLARE_OPERATOR(AnalyticLocalState)
886
DECLARE_OPERATOR(SortLocalState)
887
DECLARE_OPERATOR(SpillSortLocalState)
888
DECLARE_OPERATOR(LocalMergeSortLocalState)
889
DECLARE_OPERATOR(AggLocalState)
890
DECLARE_OPERATOR(BucketedAggLocalState)
891
DECLARE_OPERATOR(PartitionedAggLocalState)
892
DECLARE_OPERATOR(TableFunctionLocalState)
893
DECLARE_OPERATOR(ExchangeLocalState)
894
DECLARE_OPERATOR(RepeatLocalState)
895
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
896
DECLARE_OPERATOR(AssertNumRowsLocalState)
897
DECLARE_OPERATOR(EmptySetLocalState)
898
DECLARE_OPERATOR(UnionSourceLocalState)
899
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
900
DECLARE_OPERATOR(PartitionSortSourceLocalState)
901
DECLARE_OPERATOR(SetSourceLocalState<true>)
902
DECLARE_OPERATOR(SetSourceLocalState<false>)
903
DECLARE_OPERATOR(DataGenLocalState)
904
DECLARE_OPERATOR(SchemaScanLocalState)
905
DECLARE_OPERATOR(MetaScanLocalState)
906
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
907
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
908
DECLARE_OPERATOR(CacheSourceLocalState)
909
DECLARE_OPERATOR(RecCTESourceLocalState)
910
DECLARE_OPERATOR(RecCTEScanLocalState)
911
912
#ifdef BE_TEST
913
DECLARE_OPERATOR(MockLocalState)
914
DECLARE_OPERATOR(MockScanLocalState)
915
#endif
916
#undef DECLARE_OPERATOR
917
918
template class StreamingOperatorX<AssertNumRowsLocalState>;
919
template class StreamingOperatorX<SelectLocalState>;
920
921
template class StatefulOperatorX<HashJoinProbeLocalState>;
922
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
923
template class StatefulOperatorX<RepeatLocalState>;
924
template class StatefulOperatorX<MaterializationLocalState>;
925
template class StatefulOperatorX<StreamingAggLocalState>;
926
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
927
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
928
template class StatefulOperatorX<TableFunctionLocalState>;
929
930
template class PipelineXSinkLocalState<HashJoinSharedState>;
931
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
932
template class PipelineXSinkLocalState<SortSharedState>;
933
template class PipelineXSinkLocalState<SpillSortSharedState>;
934
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
935
template class PipelineXSinkLocalState<AnalyticSharedState>;
936
template class PipelineXSinkLocalState<AggSharedState>;
937
template class PipelineXSinkLocalState<BucketedAggSharedState>;
938
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
939
template class PipelineXSinkLocalState<FakeSharedState>;
940
template class PipelineXSinkLocalState<UnionSharedState>;
941
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
942
template class PipelineXSinkLocalState<MultiCastSharedState>;
943
template class PipelineXSinkLocalState<SetSharedState>;
944
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
945
template class PipelineXSinkLocalState<BasicSharedState>;
946
template class PipelineXSinkLocalState<DataQueueSharedState>;
947
template class PipelineXSinkLocalState<RecCTESharedState>;
948
949
template class PipelineXLocalState<HashJoinSharedState>;
950
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
951
template class PipelineXLocalState<SortSharedState>;
952
template class PipelineXLocalState<SpillSortSharedState>;
953
template class PipelineXLocalState<NestedLoopJoinSharedState>;
954
template class PipelineXLocalState<AnalyticSharedState>;
955
template class PipelineXLocalState<AggSharedState>;
956
template class PipelineXLocalState<BucketedAggSharedState>;
957
template class PipelineXLocalState<PartitionedAggSharedState>;
958
template class PipelineXLocalState<FakeSharedState>;
959
template class PipelineXLocalState<UnionSharedState>;
960
template class PipelineXLocalState<DataQueueSharedState>;
961
template class PipelineXLocalState<MultiCastSharedState>;
962
template class PipelineXLocalState<PartitionSortNodeSharedState>;
963
template class PipelineXLocalState<SetSharedState>;
964
template class PipelineXLocalState<LocalExchangeSharedState>;
965
template class PipelineXLocalState<BasicSharedState>;
966
template class PipelineXLocalState<RecCTESharedState>;
967
968
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
969
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
970
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
971
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
972
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
973
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
974
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
975
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
976
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
977
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
978
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
979
980
#ifdef BE_TEST
981
template class OperatorX<DummyOperatorLocalState>;
982
template class DataSinkOperatorX<DummySinkLocalState>;
983
#endif
984
985
} // namespace doris