Coverage Report

Created: 2026-03-13 14:15

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 "common/status.h"
21
#include "exec/common/util.hpp"
22
#include "exec/exchange/local_exchange_sink_operator.h"
23
#include "exec/exchange/local_exchange_source_operator.h"
24
#include "exec/operator/aggregation_sink_operator.h"
25
#include "exec/operator/aggregation_source_operator.h"
26
#include "exec/operator/analytic_sink_operator.h"
27
#include "exec/operator/analytic_source_operator.h"
28
#include "exec/operator/assert_num_rows_operator.h"
29
#include "exec/operator/blackhole_sink_operator.h"
30
#include "exec/operator/cache_sink_operator.h"
31
#include "exec/operator/cache_source_operator.h"
32
#include "exec/operator/datagen_operator.h"
33
#include "exec/operator/dict_sink_operator.h"
34
#include "exec/operator/distinct_streaming_aggregation_operator.h"
35
#include "exec/operator/empty_set_operator.h"
36
#include "exec/operator/es_scan_operator.h"
37
#include "exec/operator/exchange_sink_operator.h"
38
#include "exec/operator/exchange_source_operator.h"
39
#include "exec/operator/file_scan_operator.h"
40
#include "exec/operator/group_commit_block_sink_operator.h"
41
#include "exec/operator/group_commit_scan_operator.h"
42
#include "exec/operator/hashjoin_build_sink.h"
43
#include "exec/operator/hashjoin_probe_operator.h"
44
#include "exec/operator/hive_table_sink_operator.h"
45
#include "exec/operator/iceberg_table_sink_operator.h"
46
#include "exec/operator/jdbc_scan_operator.h"
47
#include "exec/operator/jdbc_table_sink_operator.h"
48
#include "exec/operator/local_merge_sort_source_operator.h"
49
#include "exec/operator/materialization_opertor.h"
50
#include "exec/operator/maxcompute_table_sink_operator.h"
51
#include "exec/operator/memory_scratch_sink_operator.h"
52
#include "exec/operator/meta_scan_operator.h"
53
#include "exec/operator/mock_operator.h"
54
#include "exec/operator/mock_scan_operator.h"
55
#include "exec/operator/multi_cast_data_stream_sink.h"
56
#include "exec/operator/multi_cast_data_stream_source.h"
57
#include "exec/operator/nested_loop_join_build_operator.h"
58
#include "exec/operator/nested_loop_join_probe_operator.h"
59
#include "exec/operator/olap_scan_operator.h"
60
#include "exec/operator/olap_table_sink_operator.h"
61
#include "exec/operator/olap_table_sink_v2_operator.h"
62
#include "exec/operator/partition_sort_sink_operator.h"
63
#include "exec/operator/partition_sort_source_operator.h"
64
#include "exec/operator/partitioned_aggregation_sink_operator.h"
65
#include "exec/operator/partitioned_aggregation_source_operator.h"
66
#include "exec/operator/partitioned_hash_join_probe_operator.h"
67
#include "exec/operator/partitioned_hash_join_sink_operator.h"
68
#include "exec/operator/rec_cte_anchor_sink_operator.h"
69
#include "exec/operator/rec_cte_scan_operator.h"
70
#include "exec/operator/rec_cte_sink_operator.h"
71
#include "exec/operator/rec_cte_source_operator.h"
72
#include "exec/operator/repeat_operator.h"
73
#include "exec/operator/result_file_sink_operator.h"
74
#include "exec/operator/result_sink_operator.h"
75
#include "exec/operator/schema_scan_operator.h"
76
#include "exec/operator/select_operator.h"
77
#include "exec/operator/set_probe_sink_operator.h"
78
#include "exec/operator/set_sink_operator.h"
79
#include "exec/operator/set_source_operator.h"
80
#include "exec/operator/sort_sink_operator.h"
81
#include "exec/operator/sort_source_operator.h"
82
#include "exec/operator/spill_iceberg_table_sink_operator.h"
83
#include "exec/operator/spill_sort_sink_operator.h"
84
#include "exec/operator/spill_sort_source_operator.h"
85
#include "exec/operator/streaming_aggregation_operator.h"
86
#include "exec/operator/table_function_operator.h"
87
#include "exec/operator/tvf_table_sink_operator.h"
88
#include "exec/operator/union_sink_operator.h"
89
#include "exec/operator/union_source_operator.h"
90
#include "exec/pipeline/dependency.h"
91
#include "exec/pipeline/pipeline.h"
92
#include "exprs/vexpr.h"
93
#include "exprs/vexpr_context.h"
94
#include "runtime/runtime_profile.h"
95
#include "util/debug_util.h"
96
#include "util/string_util.h"
97
98
namespace doris {
99
#include "common/compile_check_begin.h"
100
class RowDescriptor;
101
class RuntimeState;
102
} // namespace doris
103
104
namespace doris {
105
106
0
Status OperatorBase::close(RuntimeState* state) {
107
0
    if (_is_closed) {
108
0
        return Status::OK();
109
0
    }
110
0
    _is_closed = true;
111
0
    return Status::OK();
112
0
}
113
114
template <typename SharedStateArg>
115
2.25M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
2.25M
    if (_parent->nereids_id() == -1) {
117
1.15M
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
1.15M
    } else {
119
1.09M
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
1.09M
                           std::to_string(_parent->nereids_id()),
121
1.09M
                           std::to_string(_parent->node_id()));
122
1.09M
    }
123
2.25M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
132k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
132k
    if (_parent->nereids_id() == -1) {
117
0
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
132k
    } else {
119
132k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
132k
                           std::to_string(_parent->nereids_id()),
121
132k
                           std::to_string(_parent->node_id()));
122
132k
    }
123
132k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
1
    if (_parent->nereids_id() == -1) {
117
1
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
1
    } else {
119
0
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
0
                           std::to_string(_parent->nereids_id()),
121
0
                           std::to_string(_parent->node_id()));
122
0
    }
123
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
181k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
181k
    if (_parent->nereids_id() == -1) {
117
12
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
181k
    } else {
119
181k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
181k
                           std::to_string(_parent->nereids_id()),
121
181k
                           std::to_string(_parent->node_id()));
122
181k
    }
123
181k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
17
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
17
    if (_parent->nereids_id() == -1) {
117
0
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
17
    } else {
119
17
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
17
                           std::to_string(_parent->nereids_id()),
121
17
                           std::to_string(_parent->node_id()));
122
17
    }
123
17
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
5.54k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
5.54k
    if (_parent->nereids_id() == -1) {
117
0
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
5.54k
    } else {
119
5.54k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
5.54k
                           std::to_string(_parent->nereids_id()),
121
5.54k
                           std::to_string(_parent->node_id()));
122
5.54k
    }
123
5.54k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
8.63k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
8.63k
    if (_parent->nereids_id() == -1) {
117
9
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
8.62k
    } else {
119
8.62k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
8.62k
                           std::to_string(_parent->nereids_id()),
121
8.62k
                           std::to_string(_parent->node_id()));
122
8.62k
    }
123
8.63k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
122k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
122k
    if (_parent->nereids_id() == -1) {
117
27
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
122k
    } else {
119
122k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
122k
                           std::to_string(_parent->nereids_id()),
121
122k
                           std::to_string(_parent->node_id()));
122
122k
    }
123
122k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
344
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
344
    if (_parent->nereids_id() == -1) {
117
0
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
344
    } else {
119
344
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
344
                           std::to_string(_parent->nereids_id()),
121
344
                           std::to_string(_parent->node_id()));
122
344
    }
123
344
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
1.06M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
1.06M
    if (_parent->nereids_id() == -1) {
117
469k
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
598k
    } else {
119
598k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
598k
                           std::to_string(_parent->nereids_id()),
121
598k
                           std::to_string(_parent->node_id()));
122
598k
    }
123
1.06M
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
39.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
39.1k
    if (_parent->nereids_id() == -1) {
117
2
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
39.1k
    } else {
119
39.1k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
39.1k
                           std::to_string(_parent->nereids_id()),
121
39.1k
                           std::to_string(_parent->node_id()));
122
39.1k
    }
123
39.1k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
367
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
367
    if (_parent->nereids_id() == -1) {
117
367
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
367
    } else {
119
0
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
0
                           std::to_string(_parent->nereids_id()),
121
0
                           std::to_string(_parent->node_id()));
122
0
    }
123
367
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
6.32k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
6.32k
    if (_parent->nereids_id() == -1) {
117
6.32k
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
18.4E
    } else {
119
18.4E
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
18.4E
                           std::to_string(_parent->nereids_id()),
121
18.4E
                           std::to_string(_parent->node_id()));
122
18.4E
    }
123
6.32k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
435
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
435
    if (_parent->nereids_id() == -1) {
117
102
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
333
    } else {
119
333
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
333
                           std::to_string(_parent->nereids_id()),
121
333
                           std::to_string(_parent->node_id()));
122
333
    }
123
435
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
4.75k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
4.75k
    if (_parent->nereids_id() == -1) {
117
10
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
4.74k
    } else {
119
4.74k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
4.74k
                           std::to_string(_parent->nereids_id()),
121
4.74k
                           std::to_string(_parent->node_id()));
122
4.74k
    }
123
4.75k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
682k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
683k
    if (_parent->nereids_id() == -1) {
117
683k
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
18.4E
    } else {
119
18.4E
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
18.4E
                           std::to_string(_parent->nereids_id()),
121
18.4E
                           std::to_string(_parent->node_id()));
122
18.4E
    }
123
682k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
115
150
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
116
150
    if (_parent->nereids_id() == -1) {
117
0
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
118
150
    } else {
119
150
        return fmt::format("(nereids_id={})" + operator_name_suffix,
120
150
                           std::to_string(_parent->nereids_id()),
121
150
                           std::to_string(_parent->node_id()));
122
150
    }
123
150
}
124
125
template <typename SharedStateArg>
126
1.30M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
1.30M
    if (_parent->nereids_id() == -1) {
128
793k
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
793k
    } else {
130
507k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
507k
                           std::to_string(_parent->nereids_id()),
132
507k
                           std::to_string(_parent->node_id()));
133
507k
    }
134
1.30M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
181k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
181k
    if (_parent->nereids_id() == -1) {
128
0
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
181k
    } else {
130
181k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
181k
                           std::to_string(_parent->nereids_id()),
132
181k
                           std::to_string(_parent->node_id()));
133
181k
    }
134
181k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
2
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
2
    if (_parent->nereids_id() == -1) {
128
1
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
1
    } else {
130
1
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
1
                           std::to_string(_parent->nereids_id()),
132
1
                           std::to_string(_parent->node_id()));
133
1
    }
134
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
183k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
183k
    if (_parent->nereids_id() == -1) {
128
9
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
183k
    } else {
130
183k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
183k
                           std::to_string(_parent->nereids_id()),
132
183k
                           std::to_string(_parent->node_id()));
133
183k
    }
134
183k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
20
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
20
    if (_parent->nereids_id() == -1) {
128
0
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
20
    } else {
130
20
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
20
                           std::to_string(_parent->nereids_id()),
132
20
                           std::to_string(_parent->node_id()));
133
20
    }
134
20
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
5.57k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
5.57k
    if (_parent->nereids_id() == -1) {
128
0
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
5.57k
    } else {
130
5.57k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
5.57k
                           std::to_string(_parent->nereids_id()),
132
5.57k
                           std::to_string(_parent->node_id()));
133
5.57k
    }
134
5.57k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
8.63k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
8.63k
    if (_parent->nereids_id() == -1) {
128
9
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
8.62k
    } else {
130
8.62k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
8.62k
                           std::to_string(_parent->nereids_id()),
132
8.62k
                           std::to_string(_parent->node_id()));
133
8.62k
    }
134
8.63k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
122k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
122k
    if (_parent->nereids_id() == -1) {
128
27
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
122k
    } else {
130
122k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
122k
                           std::to_string(_parent->nereids_id()),
132
122k
                           std::to_string(_parent->node_id()));
133
122k
    }
134
122k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
350
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
350
    if (_parent->nereids_id() == -1) {
128
0
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
350
    } else {
130
350
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
350
                           std::to_string(_parent->nereids_id()),
132
350
                           std::to_string(_parent->node_id()));
133
350
    }
134
350
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
51
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
51
    if (_parent->nereids_id() == -1) {
128
51
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
51
    } else {
130
0
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
0
                           std::to_string(_parent->nereids_id()),
132
0
                           std::to_string(_parent->node_id()));
133
0
    }
134
51
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
6.52k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
6.52k
    if (_parent->nereids_id() == -1) {
128
3
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
6.51k
    } else {
130
6.51k
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
6.51k
                           std::to_string(_parent->nereids_id()),
132
6.51k
                           std::to_string(_parent->node_id()));
133
6.51k
    }
134
6.52k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
435
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
435
    if (_parent->nereids_id() == -1) {
128
102
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
333
    } else {
130
333
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
333
                           std::to_string(_parent->nereids_id()),
132
333
                           std::to_string(_parent->node_id()));
133
333
    }
134
435
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
11.6k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
11.6k
    if (_parent->nereids_id() == -1) {
128
11.6k
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
11.6k
    } else {
130
2
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
2
                           std::to_string(_parent->nereids_id()),
132
2
                           std::to_string(_parent->node_id()));
133
2
    }
134
11.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
310k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
311k
    if (_parent->nereids_id() == -1) {
128
311k
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
18.4E
    } else {
130
18.4E
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
18.4E
                           std::to_string(_parent->nereids_id()),
132
18.4E
                           std::to_string(_parent->node_id()));
133
18.4E
    }
134
310k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
469k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
470k
    if (_parent->nereids_id() == -1) {
128
470k
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
18.4E
    } else {
130
18.4E
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
18.4E
                           std::to_string(_parent->nereids_id()),
132
18.4E
                           std::to_string(_parent->node_id()));
133
18.4E
    }
134
469k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
369
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
369
    if (_parent->nereids_id() == -1) {
128
369
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
369
    } else {
130
0
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
0
                           std::to_string(_parent->nereids_id()),
132
0
                           std::to_string(_parent->node_id()));
133
0
    }
134
369
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
300
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
300
    if (_parent->nereids_id() == -1) {
128
0
        return fmt::format(operator_name_suffix, std::to_string(_parent->node_id()));
129
300
    } else {
130
300
        return fmt::format("(nereids_id={})" + operator_name_suffix,
131
300
                           std::to_string(_parent->nereids_id()),
132
300
                           std::to_string(_parent->node_id()));
133
300
    }
134
300
}
135
136
template <typename SharedStateArg>
137
30.4k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
30.4k
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
30.4k
    _terminated = true;
142
30.4k
    return Status::OK();
143
30.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
24.0k
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
24.0k
    _terminated = true;
142
24.0k
    return Status::OK();
143
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
1.02k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
1.02k
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
1.02k
    _terminated = true;
142
1.02k
    return Status::OK();
143
1.02k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
17
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
17
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
17
    _terminated = true;
142
17
    return Status::OK();
143
17
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
2
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
2
    _terminated = true;
142
2
    return Status::OK();
143
2
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
2.82k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
2.82k
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
2.82k
    _terminated = true;
142
2.82k
    return Status::OK();
143
2.82k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
2.21k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
2.21k
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
2.21k
    _terminated = true;
142
2.21k
    return Status::OK();
143
2.21k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
2
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
2
    _terminated = true;
142
2
    return Status::OK();
143
2
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
2
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
2
    _terminated = true;
142
2
    return Status::OK();
143
2
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
50
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
50
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
50
    _terminated = true;
142
50
    return Status::OK();
143
50
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
148
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
148
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
148
    _terminated = true;
142
148
    return Status::OK();
143
148
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
137
137
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
138
137
    if (_terminated) {
139
0
        return Status::OK();
140
0
    }
141
137
    _terminated = true;
142
137
    return Status::OK();
143
137
}
144
145
602k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
146
602k
    return _child && _child->is_serial_operator() && !is_source()
147
602k
                   ? DataDistribution(ExchangeType::PASSTHROUGH)
148
602k
                   : DataDistribution(ExchangeType::NOOP);
149
602k
}
150
151
81.0k
const RowDescriptor& OperatorBase::row_desc() const {
152
81.0k
    return _child->row_desc();
153
81.0k
}
154
155
template <typename SharedStateArg>
156
52.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
157
52.5k
    fmt::memory_buffer debug_string_buffer;
158
52.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
159
52.5k
    return fmt::to_string(debug_string_buffer);
160
52.5k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
156
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
157
3
    fmt::memory_buffer debug_string_buffer;
158
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
159
3
    return fmt::to_string(debug_string_buffer);
160
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_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
156
52.5k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
157
52.5k
    fmt::memory_buffer debug_string_buffer;
158
52.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
159
52.5k
    return fmt::to_string(debug_string_buffer);
160
52.5k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
156
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
157
1
    fmt::memory_buffer debug_string_buffer;
158
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
159
1
    return fmt::to_string(debug_string_buffer);
160
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
161
162
template <typename SharedStateArg>
163
52.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
164
52.5k
    fmt::memory_buffer debug_string_buffer;
165
52.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
166
52.5k
    return fmt::to_string(debug_string_buffer);
167
52.5k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_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
163
52.5k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
164
52.5k
    fmt::memory_buffer debug_string_buffer;
165
52.5k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
166
52.5k
    return fmt::to_string(debug_string_buffer);
167
52.5k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
168
169
52.6k
std::string OperatorXBase::debug_string(int indentation_level) const {
170
52.6k
    fmt::memory_buffer debug_string_buffer;
171
52.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
172
52.6k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
173
52.6k
                   _is_serial_operator);
174
52.6k
    return fmt::to_string(debug_string_buffer);
175
52.6k
}
176
177
52.5k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
178
52.5k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
179
52.5k
}
180
181
569k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
182
569k
    std::string node_name = print_plan_node_type(tnode.node_type);
183
569k
    _nereids_id = tnode.nereids_id;
184
569k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
185
2.89k
        if (!tnode.__isset.output_tuple_id) {
186
0
            return Status::InternalError("no final output tuple id");
187
0
        }
188
2.89k
        if (tnode.intermediate_output_tuple_id_list.size() !=
189
2.89k
            tnode.intermediate_projections_list.size()) {
190
0
            return Status::InternalError(
191
0
                    "intermediate_output_tuple_id_list size:{} not match "
192
0
                    "intermediate_projections_list size:{}",
193
0
                    tnode.intermediate_output_tuple_id_list.size(),
194
0
                    tnode.intermediate_projections_list.size());
195
0
        }
196
2.89k
    }
197
569k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
198
569k
    _op_name = substr + "_OPERATOR";
199
200
569k
    if (tnode.__isset.vconjunct) {
201
0
        return Status::InternalError("vconjunct is not supported yet");
202
569k
    } else if (tnode.__isset.conjuncts) {
203
258k
        for (const auto& conjunct : tnode.conjuncts) {
204
258k
            VExprContextSPtr context;
205
258k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
206
258k
            _conjuncts.emplace_back(context);
207
258k
        }
208
87.7k
    }
209
210
    // create the projections expr
211
569k
    if (tnode.__isset.projections) {
212
245k
        DCHECK(tnode.__isset.output_tuple_id);
213
245k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projections));
214
245k
    }
215
569k
    if (!tnode.intermediate_projections_list.empty()) {
216
2.89k
        DCHECK(tnode.__isset.projections) << "no final projections";
217
2.89k
        _intermediate_projections.reserve(tnode.intermediate_projections_list.size());
218
3.78k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
219
3.78k
            VExprContextSPtrs projections;
220
3.78k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
221
3.78k
            _intermediate_projections.push_back(projections);
222
3.78k
        }
223
2.89k
    }
224
569k
    return Status::OK();
225
569k
}
226
227
597k
Status OperatorXBase::prepare(RuntimeState* state) {
228
597k
    for (auto& conjunct : _conjuncts) {
229
258k
        RETURN_IF_ERROR(conjunct->prepare(state, intermediate_row_desc()));
230
258k
    }
231
597k
    if (state->enable_adjust_conjunct_order_by_cost()) {
232
546k
        std::ranges::sort(_conjuncts, [](const auto& a, const auto& b) {
233
341k
            return a->execute_cost() < b->execute_cost();
234
341k
        });
235
546k
    };
236
237
600k
    for (int i = 0; i < _intermediate_projections.size(); i++) {
238
3.78k
        RETURN_IF_ERROR(
239
3.78k
                VExpr::prepare(_intermediate_projections[i], state, intermediate_row_desc(i)));
240
3.78k
    }
241
597k
    RETURN_IF_ERROR(VExpr::prepare(_projections, state, projections_row_desc()));
242
243
597k
    if (has_output_row_desc()) {
244
245k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(_projections, *_output_row_descriptor));
245
245k
    }
246
247
597k
    for (auto& conjunct : _conjuncts) {
248
258k
        RETURN_IF_ERROR(conjunct->open(state));
249
258k
    }
250
597k
    RETURN_IF_ERROR(VExpr::open(_projections, state));
251
597k
    for (auto& projections : _intermediate_projections) {
252
3.78k
        RETURN_IF_ERROR(VExpr::open(projections, state));
253
3.78k
    }
254
597k
    if (_child && !is_source()) {
255
138k
        RETURN_IF_ERROR(_child->prepare(state));
256
138k
    }
257
258
597k
    if (VExpr::contains_blockable_function(_conjuncts) ||
259
597k
        VExpr::contains_blockable_function(_projections)) {
260
0
        _blockable = true;
261
0
    }
262
263
597k
    return Status::OK();
264
597k
}
265
266
8.56k
Status OperatorXBase::terminate(RuntimeState* state) {
267
8.56k
    if (_child && !is_source()) {
268
2.12k
        RETURN_IF_ERROR(_child->terminate(state));
269
2.12k
    }
270
8.56k
    auto result = state->get_local_state_result(operator_id());
271
8.56k
    if (!result) {
272
0
        return result.error();
273
0
    }
274
8.56k
    return result.value()->terminate(state);
275
8.56k
}
276
277
6.62M
Status OperatorXBase::close(RuntimeState* state) {
278
6.62M
    if (_child && !is_source()) {
279
1.51M
        RETURN_IF_ERROR(_child->close(state));
280
1.51M
    }
281
6.62M
    auto result = state->get_local_state_result(operator_id());
282
6.62M
    if (!result) {
283
0
        return result.error();
284
0
    }
285
6.62M
    return result.value()->close(state);
286
6.62M
}
287
288
336k
void PipelineXLocalStateBase::clear_origin_block() {
289
336k
    _origin_block.clear_column_data(_parent->intermediate_row_desc().num_materialized_slots());
290
336k
}
291
292
644k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
293
644k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
294
295
644k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
296
644k
    return Status::OK();
297
644k
}
298
299
0
bool PipelineXLocalStateBase::is_blockable() const {
300
0
    return std::any_of(_projections.begin(), _projections.end(),
301
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
302
0
}
303
304
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
305
336k
                                     Block* output_block) const {
306
336k
    auto* local_state = state->get_local_state(operator_id());
307
336k
    SCOPED_TIMER(local_state->exec_time_counter());
308
336k
    SCOPED_TIMER(local_state->_projection_timer);
309
336k
    const size_t rows = origin_block->rows();
310
336k
    if (rows == 0) {
311
217k
        return Status::OK();
312
217k
    }
313
118k
    Block input_block = *origin_block;
314
315
118k
    size_t bytes_usage = 0;
316
118k
    ColumnsWithTypeAndName new_columns;
317
118k
    for (const auto& projections : local_state->_intermediate_projections) {
318
1.08k
        if (projections.empty()) {
319
0
            return Status::InternalError("meet empty intermediate projection, node id: {}",
320
0
                                         node_id());
321
0
        }
322
1.08k
        new_columns.resize(projections.size());
323
7.38k
        for (int i = 0; i < projections.size(); i++) {
324
6.30k
            RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
325
6.30k
            if (new_columns[i].column->size() != rows) {
326
0
                return Status::InternalError(
327
0
                        "intermediate projection result column size {} not equal input rows {}, "
328
0
                        "expr: {}",
329
0
                        new_columns[i].column->size(), rows,
330
0
                        projections[i]->root()->debug_string());
331
0
            }
332
6.30k
        }
333
1.08k
        Block tmp_block {new_columns};
334
1.08k
        bytes_usage += tmp_block.allocated_bytes();
335
1.08k
        input_block.swap(tmp_block);
336
1.08k
    }
337
338
118k
    if (input_block.rows() != rows) {
339
0
        return Status::InternalError(
340
0
                "after intermediate projections input block rows {} not equal origin rows {}, "
341
0
                "input_block: {}",
342
0
                input_block.rows(), rows, input_block.dump_structure());
343
0
    }
344
589k
    auto insert_column_datas = [&](auto& to, ColumnPtr& from, size_t rows) {
345
589k
        if (to->is_nullable() && !from->is_nullable()) {
346
0
            if (_keep_origin || !from->is_exclusive()) {
347
0
                auto& null_column = reinterpret_cast<ColumnNullable&>(*to);
348
0
                null_column.get_nested_column().insert_range_from(*from, 0, rows);
349
0
                null_column.get_null_map_column().get_data().resize_fill(rows, 0);
350
0
                bytes_usage += null_column.allocated_bytes();
351
0
            } else {
352
0
                to = make_nullable(from, false)->assume_mutable();
353
0
            }
354
589k
        } else {
355
589k
            if (_keep_origin || !from->is_exclusive()) {
356
579k
                to->insert_range_from(*from, 0, rows);
357
579k
                bytes_usage += from->allocated_bytes();
358
579k
            } else {
359
9.91k
                to = from->assume_mutable();
360
9.91k
            }
361
589k
        }
362
589k
    };
363
364
118k
    MutableBlock mutable_block =
365
118k
            VectorizedUtils::build_mutable_mem_reuse_block(output_block, *_output_row_descriptor);
366
118k
    if (rows != 0) {
367
118k
        auto& mutable_columns = mutable_block.mutable_columns();
368
118k
        const size_t origin_columns_count = input_block.columns();
369
118k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
707k
        for (int i = 0; i < mutable_columns.size(); ++i) {
371
589k
            auto result_column_id = -1;
372
589k
            ColumnPtr column_ptr;
373
589k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
374
589k
            if (column_ptr->size() != rows) {
375
0
                return Status::InternalError(
376
0
                        "projection result column size {} not equal input rows {}, expr: {}",
377
0
                        column_ptr->size(), rows,
378
0
                        local_state->_projections[i]->root()->debug_string());
379
0
            }
380
589k
            column_ptr = column_ptr->convert_to_full_column_if_const();
381
589k
            if (result_column_id >= origin_columns_count) {
382
589k
                bytes_usage += column_ptr->allocated_bytes();
383
589k
            }
384
589k
            insert_column_datas(mutable_columns[i], column_ptr, rows);
385
589k
        }
386
118k
        DCHECK(mutable_block.rows() == rows);
387
118k
        output_block->set_columns(std::move(mutable_columns));
388
118k
    }
389
390
118k
    local_state->_estimate_memory_usage += bytes_usage;
391
392
118k
    return Status::OK();
393
118k
}
394
395
3.90M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
396
3.90M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
397
3.90M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
398
3.90M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
399
3.90M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
400
3.90M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
401
3.90M
            if (_debug_point_count++ % 2 == 0) {
402
3.90M
                return Status::OK();
403
3.90M
            }
404
3.90M
        }
405
3.90M
    });
406
407
3.90M
    Status status;
408
3.90M
    auto* local_state = state->get_local_state(operator_id());
409
3.90M
    Defer defer([&]() {
410
3.90M
        if (status.ok()) {
411
3.90M
            if (auto rows = block->rows()) {
412
704k
                COUNTER_UPDATE(local_state->_rows_returned_counter, rows);
413
704k
                COUNTER_UPDATE(local_state->_blocks_returned_counter, 1);
414
704k
            }
415
3.90M
        }
416
3.90M
    });
417
3.90M
    if (_output_row_descriptor) {
418
335k
        local_state->clear_origin_block();
419
335k
        status = get_block(state, &local_state->_origin_block, eos);
420
335k
        if (UNLIKELY(!status.ok())) {
421
13
            return status;
422
13
        }
423
335k
        status = do_projections(state, &local_state->_origin_block, block);
424
335k
        return status;
425
335k
    }
426
3.56M
    status = get_block(state, block, eos);
427
3.56M
    RETURN_IF_ERROR(block->check_type_and_column());
428
3.56M
    return status;
429
3.56M
}
430
431
2.37M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
432
2.37M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
433
1.74k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
434
1.74k
        *eos = true;
435
1.74k
    }
436
437
2.37M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
438
2.37M
        auto op_name = to_lower(_parent->_op_name);
439
2.37M
        auto arg_op_name = dp->param<std::string>("op_name");
440
2.37M
        arg_op_name = to_lower(arg_op_name);
441
442
2.37M
        if (op_name == arg_op_name) {
443
2.37M
            *eos = true;
444
2.37M
        }
445
2.37M
    });
446
447
2.37M
    if (auto rows = block->rows()) {
448
630k
        _num_rows_returned += rows;
449
630k
    }
450
2.37M
}
451
452
30.4k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
453
30.4k
    auto result = state->get_sink_local_state_result();
454
30.4k
    if (!result) {
455
0
        return result.error();
456
0
    }
457
30.4k
    return result.value()->terminate(state);
458
30.4k
}
459
460
52.5k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
461
52.5k
    fmt::memory_buffer debug_string_buffer;
462
463
52.5k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
464
52.5k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
465
52.5k
    return fmt::to_string(debug_string_buffer);
466
52.5k
}
467
468
52.5k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
469
52.5k
    return state->get_sink_local_state()->debug_string(indentation_level);
470
52.5k
}
471
472
334k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
473
334k
    std::string op_name = "UNKNOWN_SINK";
474
334k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
475
476
335k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
477
335k
        op_name = it->second;
478
335k
    }
479
334k
    _name = op_name + "_OPERATOR";
480
334k
    return Status::OK();
481
334k
}
482
483
169k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
484
169k
    std::string op_name = print_plan_node_type(tnode.node_type);
485
169k
    _nereids_id = tnode.nereids_id;
486
169k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
487
169k
    _name = substr + "_SINK_OPERATOR";
488
169k
    return Status::OK();
489
169k
}
490
491
template <typename LocalStateType>
492
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
493
1.91M
                                                            LocalSinkStateInfo& info) {
494
1.91M
    auto local_state = LocalStateType::create_unique(this, state);
495
1.91M
    RETURN_IF_ERROR(local_state->init(state, info));
496
1.91M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
1.91M
    return Status::OK();
498
1.91M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
181k
                                                            LocalSinkStateInfo& info) {
494
181k
    auto local_state = LocalStateType::create_unique(this, state);
495
181k
    RETURN_IF_ERROR(local_state->init(state, info));
496
181k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
181k
    return Status::OK();
498
181k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
403k
                                                            LocalSinkStateInfo& info) {
494
403k
    auto local_state = LocalStateType::create_unique(this, state);
495
403k
    RETURN_IF_ERROR(local_state->init(state, info));
496
403k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
403k
    return Status::OK();
498
403k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
3
                                                            LocalSinkStateInfo& info) {
494
3
    auto local_state = LocalStateType::create_unique(this, state);
495
3
    RETURN_IF_ERROR(local_state->init(state, info));
496
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
3
    return Status::OK();
498
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
328
                                                            LocalSinkStateInfo& info) {
494
328
    auto local_state = LocalStateType::create_unique(this, state);
495
328
    RETURN_IF_ERROR(local_state->init(state, info));
496
328
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
328
    return Status::OK();
498
328
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
65.5k
                                                            LocalSinkStateInfo& info) {
494
65.5k
    auto local_state = LocalStateType::create_unique(this, state);
495
65.5k
    RETURN_IF_ERROR(local_state->init(state, info));
496
65.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
65.5k
    return Status::OK();
498
65.5k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
20
                                                            LocalSinkStateInfo& info) {
494
20
    auto local_state = LocalStateType::create_unique(this, state);
495
20
    RETURN_IF_ERROR(local_state->init(state, info));
496
20
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
20
    return Status::OK();
498
20
}
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_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
8.63k
                                                            LocalSinkStateInfo& info) {
494
8.63k
    auto local_state = LocalStateType::create_unique(this, state);
495
8.63k
    RETURN_IF_ERROR(local_state->init(state, info));
496
8.63k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
8.63k
    return Status::OK();
498
8.63k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
48
                                                            LocalSinkStateInfo& info) {
494
48
    auto local_state = LocalStateType::create_unique(this, state);
495
48
    RETURN_IF_ERROR(local_state->init(state, info));
496
48
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
48
    return Status::OK();
498
48
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
183k
                                                            LocalSinkStateInfo& info) {
494
183k
    auto local_state = LocalStateType::create_unique(this, state);
495
183k
    RETURN_IF_ERROR(local_state->init(state, info));
496
183k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
183k
    return Status::OK();
498
183k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
20
                                                            LocalSinkStateInfo& info) {
494
20
    auto local_state = LocalStateType::create_unique(this, state);
495
20
    RETURN_IF_ERROR(local_state->init(state, info));
496
20
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
20
    return Status::OK();
498
20
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
311k
                                                            LocalSinkStateInfo& info) {
494
311k
    auto local_state = LocalStateType::create_unique(this, state);
495
311k
    RETURN_IF_ERROR(local_state->init(state, info));
496
311k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
311k
    return Status::OK();
498
311k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
122k
                                                            LocalSinkStateInfo& info) {
494
122k
    auto local_state = LocalStateType::create_unique(this, state);
495
122k
    RETURN_IF_ERROR(local_state->init(state, info));
496
122k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
122k
    return Status::OK();
498
122k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
350
                                                            LocalSinkStateInfo& info) {
494
350
    auto local_state = LocalStateType::create_unique(this, state);
495
350
    RETURN_IF_ERROR(local_state->init(state, info));
496
350
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
350
    return Status::OK();
498
350
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
614k
                                                            LocalSinkStateInfo& info) {
494
614k
    auto local_state = LocalStateType::create_unique(this, state);
495
614k
    RETURN_IF_ERROR(local_state->init(state, info));
496
614k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
614k
    return Status::OK();
498
614k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
5.58k
                                                            LocalSinkStateInfo& info) {
494
5.58k
    auto local_state = LocalStateType::create_unique(this, state);
495
5.58k
    RETURN_IF_ERROR(local_state->init(state, info));
496
5.58k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
5.58k
    return Status::OK();
498
5.58k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
6.51k
                                                            LocalSinkStateInfo& info) {
494
6.51k
    auto local_state = LocalStateType::create_unique(this, state);
495
6.51k
    RETURN_IF_ERROR(local_state->init(state, info));
496
6.51k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
6.51k
    return Status::OK();
498
6.51k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
2.37k
                                                            LocalSinkStateInfo& info) {
494
2.37k
    auto local_state = LocalStateType::create_unique(this, state);
495
2.37k
    RETURN_IF_ERROR(local_state->init(state, info));
496
2.37k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
2.37k
    return Status::OK();
498
2.37k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
333
                                                            LocalSinkStateInfo& info) {
494
333
    auto local_state = LocalStateType::create_unique(this, state);
495
333
    RETURN_IF_ERROR(local_state->init(state, info));
496
333
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
333
    return Status::OK();
498
333
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
4.49k
                                                            LocalSinkStateInfo& info) {
494
4.49k
    auto local_state = LocalStateType::create_unique(this, state);
495
4.49k
    RETURN_IF_ERROR(local_state->init(state, info));
496
4.49k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
4.49k
    return Status::OK();
498
4.49k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
2.40k
                                                            LocalSinkStateInfo& info) {
494
2.40k
    auto local_state = LocalStateType::create_unique(this, state);
495
2.40k
    RETURN_IF_ERROR(local_state->init(state, info));
496
2.40k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
2.40k
    return Status::OK();
498
2.40k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
2.33k
                                                            LocalSinkStateInfo& info) {
494
2.33k
    auto local_state = LocalStateType::create_unique(this, state);
495
2.33k
    RETURN_IF_ERROR(local_state->init(state, info));
496
2.33k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
2.33k
    return Status::OK();
498
2.33k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
2.39k
                                                            LocalSinkStateInfo& info) {
494
2.39k
    auto local_state = LocalStateType::create_unique(this, state);
495
2.39k
    RETURN_IF_ERROR(local_state->init(state, info));
496
2.39k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
2.39k
    return Status::OK();
498
2.39k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
1
                                                            LocalSinkStateInfo& info) {
494
1
    auto local_state = LocalStateType::create_unique(this, state);
495
1
    RETURN_IF_ERROR(local_state->init(state, info));
496
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
1
    return Status::OK();
498
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
163
                                                            LocalSinkStateInfo& info) {
494
163
    auto local_state = LocalStateType::create_unique(this, state);
495
163
    RETURN_IF_ERROR(local_state->init(state, info));
496
163
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
163
    return Status::OK();
498
163
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
365
                                                            LocalSinkStateInfo& info) {
494
365
    auto local_state = LocalStateType::create_unique(this, state);
495
365
    RETURN_IF_ERROR(local_state->init(state, info));
496
365
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
365
    return Status::OK();
498
365
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
102
                                                            LocalSinkStateInfo& info) {
494
102
    auto local_state = LocalStateType::create_unique(this, state);
495
102
    RETURN_IF_ERROR(local_state->init(state, info));
496
102
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
102
    return Status::OK();
498
102
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
150
                                                            LocalSinkStateInfo& info) {
494
150
    auto local_state = LocalStateType::create_unique(this, state);
495
150
    RETURN_IF_ERROR(local_state->init(state, info));
496
150
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
150
    return Status::OK();
498
150
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
493
150
                                                            LocalSinkStateInfo& info) {
494
150
    auto local_state = LocalStateType::create_unique(this, state);
495
150
    RETURN_IF_ERROR(local_state->init(state, info));
496
150
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
497
150
    return Status::OK();
498
150
}
499
500
template <typename LocalStateType>
501
1.57M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
0
                                 LocalExchangeSharedState>) {
504
0
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
0
                                        MultiCastSharedState>) {
507
0
        throw Exception(Status::FatalError("should not reach here!"));
508
1.57M
    } else {
509
1.57M
        auto ss = LocalStateType::SharedStateType::create_shared();
510
1.57M
        ss->id = operator_id();
511
1.57M
        for (auto& dest : dests_id()) {
512
1.57M
            ss->related_op_ids.insert(dest);
513
1.57M
        }
514
1.57M
        return ss;
515
1.57M
    }
516
1.57M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
167k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
167k
    } else {
509
167k
        auto ss = LocalStateType::SharedStateType::create_shared();
510
167k
        ss->id = operator_id();
511
167k
        for (auto& dest : dests_id()) {
512
167k
            ss->related_op_ids.insert(dest);
513
167k
        }
514
167k
        return ss;
515
167k
    }
516
167k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
404k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
404k
    } else {
509
404k
        auto ss = LocalStateType::SharedStateType::create_shared();
510
404k
        ss->id = operator_id();
511
404k
        for (auto& dest : dests_id()) {
512
403k
            ss->related_op_ids.insert(dest);
513
403k
        }
514
404k
        return ss;
515
404k
    }
516
404k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
3
    } else {
509
3
        auto ss = LocalStateType::SharedStateType::create_shared();
510
3
        ss->id = operator_id();
511
3
        for (auto& dest : dests_id()) {
512
3
            ss->related_op_ids.insert(dest);
513
3
        }
514
3
        return ss;
515
3
    }
516
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
331
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
331
    } else {
509
331
        auto ss = LocalStateType::SharedStateType::create_shared();
510
331
        ss->id = operator_id();
511
331
        for (auto& dest : dests_id()) {
512
329
            ss->related_op_ids.insert(dest);
513
329
        }
514
331
        return ss;
515
331
    }
516
331
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
64.8k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
64.8k
    } else {
509
64.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
510
64.8k
        ss->id = operator_id();
511
64.8k
        for (auto& dest : dests_id()) {
512
64.6k
            ss->related_op_ids.insert(dest);
513
64.6k
        }
514
64.8k
        return ss;
515
64.8k
    }
516
64.8k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
501
20
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
20
    } else {
509
20
        auto ss = LocalStateType::SharedStateType::create_shared();
510
20
        ss->id = operator_id();
511
20
        for (auto& dest : dests_id()) {
512
20
            ss->related_op_ids.insert(dest);
513
20
        }
514
20
        return ss;
515
20
    }
516
20
}
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_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
8.64k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
8.64k
    } else {
509
8.64k
        auto ss = LocalStateType::SharedStateType::create_shared();
510
8.64k
        ss->id = operator_id();
511
8.64k
        for (auto& dest : dests_id()) {
512
8.64k
            ss->related_op_ids.insert(dest);
513
8.64k
        }
514
8.64k
        return ss;
515
8.64k
    }
516
8.64k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
48
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
48
    } else {
509
48
        auto ss = LocalStateType::SharedStateType::create_shared();
510
48
        ss->id = operator_id();
511
48
        for (auto& dest : dests_id()) {
512
48
            ss->related_op_ids.insert(dest);
513
48
        }
514
48
        return ss;
515
48
    }
516
48
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
183k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
183k
    } else {
509
183k
        auto ss = LocalStateType::SharedStateType::create_shared();
510
183k
        ss->id = operator_id();
511
183k
        for (auto& dest : dests_id()) {
512
183k
            ss->related_op_ids.insert(dest);
513
183k
        }
514
183k
        return ss;
515
183k
    }
516
183k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
22
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
22
    } else {
509
22
        auto ss = LocalStateType::SharedStateType::create_shared();
510
22
        ss->id = operator_id();
511
22
        for (auto& dest : dests_id()) {
512
22
            ss->related_op_ids.insert(dest);
513
22
        }
514
22
        return ss;
515
22
    }
516
22
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
122k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
122k
    } else {
509
122k
        auto ss = LocalStateType::SharedStateType::create_shared();
510
122k
        ss->id = operator_id();
511
122k
        for (auto& dest : dests_id()) {
512
122k
            ss->related_op_ids.insert(dest);
513
122k
        }
514
122k
        return ss;
515
122k
    }
516
122k
}
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
349
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
349
    } else {
509
349
        auto ss = LocalStateType::SharedStateType::create_shared();
510
349
        ss->id = operator_id();
511
349
        for (auto& dest : dests_id()) {
512
349
            ss->related_op_ids.insert(dest);
513
349
        }
514
349
        return ss;
515
349
    }
516
349
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
615k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
615k
    } else {
509
615k
        auto ss = LocalStateType::SharedStateType::create_shared();
510
615k
        ss->id = operator_id();
511
615k
        for (auto& dest : dests_id()) {
512
611k
            ss->related_op_ids.insert(dest);
513
611k
        }
514
615k
        return ss;
515
615k
    }
516
615k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
5.58k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
5.58k
    } else {
509
5.58k
        auto ss = LocalStateType::SharedStateType::create_shared();
510
5.58k
        ss->id = operator_id();
511
5.58k
        for (auto& dest : dests_id()) {
512
5.58k
            ss->related_op_ids.insert(dest);
513
5.58k
        }
514
5.58k
        return ss;
515
5.58k
    }
516
5.58k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
435
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
435
    } else {
509
435
        auto ss = LocalStateType::SharedStateType::create_shared();
510
435
        ss->id = operator_id();
511
435
        for (auto& dest : dests_id()) {
512
435
            ss->related_op_ids.insert(dest);
513
435
        }
514
435
        return ss;
515
435
    }
516
435
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
501
2.33k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
2.33k
    } else {
509
2.33k
        auto ss = LocalStateType::SharedStateType::create_shared();
510
2.33k
        ss->id = operator_id();
511
2.33k
        for (auto& dest : dests_id()) {
512
2.33k
            ss->related_op_ids.insert(dest);
513
2.33k
        }
514
2.33k
        return ss;
515
2.33k
    }
516
2.33k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
501
2.39k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
2.39k
    } else {
509
2.39k
        auto ss = LocalStateType::SharedStateType::create_shared();
510
2.39k
        ss->id = operator_id();
511
2.39k
        for (auto& dest : dests_id()) {
512
2.38k
            ss->related_op_ids.insert(dest);
513
2.38k
        }
514
2.39k
        return ss;
515
2.39k
    }
516
2.39k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
163
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
163
    } else {
509
163
        auto ss = LocalStateType::SharedStateType::create_shared();
510
163
        ss->id = operator_id();
511
163
        for (auto& dest : dests_id()) {
512
163
            ss->related_op_ids.insert(dest);
513
163
        }
514
163
        return ss;
515
163
    }
516
163
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
501
105
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
502
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
503
                                 LocalExchangeSharedState>) {
504
        return nullptr;
505
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                        MultiCastSharedState>) {
507
        throw Exception(Status::FatalError("should not reach here!"));
508
105
    } else {
509
105
        auto ss = LocalStateType::SharedStateType::create_shared();
510
105
        ss->id = operator_id();
511
105
        for (auto& dest : dests_id()) {
512
105
            ss->related_op_ids.insert(dest);
513
105
        }
514
105
        return ss;
515
105
    }
516
105
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
517
518
template <typename LocalStateType>
519
2.57M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
2.57M
    auto local_state = LocalStateType::create_unique(state, this);
521
2.57M
    RETURN_IF_ERROR(local_state->init(state, info));
522
2.57M
    state->emplace_local_state(operator_id(), std::move(local_state));
523
2.57M
    return Status::OK();
524
2.57M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
132k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
132k
    auto local_state = LocalStateType::create_unique(state, this);
521
132k
    RETURN_IF_ERROR(local_state->init(state, info));
522
132k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
132k
    return Status::OK();
524
132k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
311k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
311k
    auto local_state = LocalStateType::create_unique(state, this);
521
311k
    RETURN_IF_ERROR(local_state->init(state, info));
522
311k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
311k
    return Status::OK();
524
311k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
76
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
76
    auto local_state = LocalStateType::create_unique(state, this);
521
76
    RETURN_IF_ERROR(local_state->init(state, info));
522
76
    state->emplace_local_state(operator_id(), std::move(local_state));
523
76
    return Status::OK();
524
76
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
2.71k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
2.71k
    auto local_state = LocalStateType::create_unique(state, this);
521
2.71k
    RETURN_IF_ERROR(local_state->init(state, info));
522
2.71k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
2.71k
    return Status::OK();
524
2.71k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_16EsScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
8.62k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
8.62k
    auto local_state = LocalStateType::create_unique(state, this);
521
8.62k
    RETURN_IF_ERROR(local_state->init(state, info));
522
8.62k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
8.62k
    return Status::OK();
524
8.62k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
10.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
10.8k
    auto local_state = LocalStateType::create_unique(state, this);
521
10.8k
    RETURN_IF_ERROR(local_state->init(state, info));
522
10.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
10.8k
    return Status::OK();
524
10.8k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
17
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
17
    auto local_state = LocalStateType::create_unique(state, this);
521
17
    RETURN_IF_ERROR(local_state->init(state, info));
522
17
    state->emplace_local_state(operator_id(), std::move(local_state));
523
17
    return Status::OK();
524
17
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
171k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
171k
    auto local_state = LocalStateType::create_unique(state, this);
521
171k
    RETURN_IF_ERROR(local_state->init(state, info));
522
171k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
171k
    return Status::OK();
524
171k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
122k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
122k
    auto local_state = LocalStateType::create_unique(state, this);
521
122k
    RETURN_IF_ERROR(local_state->init(state, info));
522
122k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
122k
    return Status::OK();
524
122k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
344
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
344
    auto local_state = LocalStateType::create_unique(state, this);
521
344
    RETURN_IF_ERROR(local_state->init(state, info));
522
344
    state->emplace_local_state(operator_id(), std::move(local_state));
523
344
    return Status::OK();
524
344
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
4.84k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
4.84k
    auto local_state = LocalStateType::create_unique(state, this);
521
4.84k
    RETURN_IF_ERROR(local_state->init(state, info));
522
4.84k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
4.84k
    return Status::OK();
524
4.84k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
470k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
470k
    auto local_state = LocalStateType::create_unique(state, this);
521
470k
    RETURN_IF_ERROR(local_state->init(state, info));
522
470k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
470k
    return Status::OK();
524
470k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
1.01k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
1.01k
    auto local_state = LocalStateType::create_unique(state, this);
521
1.01k
    RETURN_IF_ERROR(local_state->init(state, info));
522
1.01k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
1.01k
    return Status::OK();
524
1.01k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
5.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
5.57k
    auto local_state = LocalStateType::create_unique(state, this);
521
5.57k
    RETURN_IF_ERROR(local_state->init(state, info));
522
5.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
5.57k
    return Status::OK();
524
5.57k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
21
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
21
    auto local_state = LocalStateType::create_unique(state, this);
521
21
    RETURN_IF_ERROR(local_state->init(state, info));
522
21
    state->emplace_local_state(operator_id(), std::move(local_state));
523
21
    return Status::OK();
524
21
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
1.55k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
1.55k
    auto local_state = LocalStateType::create_unique(state, this);
521
1.55k
    RETURN_IF_ERROR(local_state->init(state, info));
522
1.55k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
1.55k
    return Status::OK();
524
1.55k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
39.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
39.3k
    auto local_state = LocalStateType::create_unique(state, this);
521
39.3k
    RETURN_IF_ERROR(local_state->init(state, info));
522
39.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
39.3k
    return Status::OK();
524
39.3k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
6.31k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
6.31k
    auto local_state = LocalStateType::create_unique(state, this);
521
6.31k
    RETURN_IF_ERROR(local_state->init(state, info));
522
6.31k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
6.31k
    return Status::OK();
524
6.31k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
333
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
333
    auto local_state = LocalStateType::create_unique(state, this);
521
333
    RETURN_IF_ERROR(local_state->init(state, info));
522
333
    state->emplace_local_state(operator_id(), std::move(local_state));
523
333
    return Status::OK();
524
333
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
2.34k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
2.34k
    auto local_state = LocalStateType::create_unique(state, this);
521
2.34k
    RETURN_IF_ERROR(local_state->init(state, info));
522
2.34k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
2.34k
    return Status::OK();
524
2.34k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
2.39k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
2.39k
    auto local_state = LocalStateType::create_unique(state, this);
521
2.39k
    RETURN_IF_ERROR(local_state->init(state, info));
522
2.39k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
2.39k
    return Status::OK();
524
2.39k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
264
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
264
    auto local_state = LocalStateType::create_unique(state, this);
521
264
    RETURN_IF_ERROR(local_state->init(state, info));
522
264
    state->emplace_local_state(operator_id(), std::move(local_state));
523
264
    return Status::OK();
524
264
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
1.52k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
1.52k
    auto local_state = LocalStateType::create_unique(state, this);
521
1.52k
    RETURN_IF_ERROR(local_state->init(state, info));
522
1.52k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
1.52k
    return Status::OK();
524
1.52k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
5.00k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
5.00k
    auto local_state = LocalStateType::create_unique(state, this);
521
5.00k
    RETURN_IF_ERROR(local_state->init(state, info));
522
5.00k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
5.00k
    return Status::OK();
524
5.00k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
686k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
686k
    auto local_state = LocalStateType::create_unique(state, this);
521
686k
    RETURN_IF_ERROR(local_state->init(state, info));
522
686k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
686k
    return Status::OK();
524
686k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
363
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
363
    auto local_state = LocalStateType::create_unique(state, this);
521
363
    RETURN_IF_ERROR(local_state->init(state, info));
522
363
    state->emplace_local_state(operator_id(), std::move(local_state));
523
363
    return Status::OK();
524
363
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
150
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
150
    auto local_state = LocalStateType::create_unique(state, this);
521
150
    RETURN_IF_ERROR(local_state->init(state, info));
522
150
    state->emplace_local_state(operator_id(), std::move(local_state));
523
150
    return Status::OK();
524
150
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
1.84k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
1.84k
    auto local_state = LocalStateType::create_unique(state, this);
521
1.84k
    RETURN_IF_ERROR(local_state->init(state, info));
522
1.84k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
1.84k
    return Status::OK();
524
1.84k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
668
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
668
    auto local_state = LocalStateType::create_unique(state, this);
521
668
    RETURN_IF_ERROR(local_state->init(state, info));
522
668
    state->emplace_local_state(operator_id(), std::move(local_state));
523
668
    return Status::OK();
524
668
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
1.06k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
1.06k
    auto local_state = LocalStateType::create_unique(state, this);
521
1.06k
    RETURN_IF_ERROR(local_state->init(state, info));
522
1.06k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
1.06k
    return Status::OK();
524
1.06k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
8.13k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
8.13k
    auto local_state = LocalStateType::create_unique(state, this);
521
8.13k
    RETURN_IF_ERROR(local_state->init(state, info));
522
8.13k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
8.13k
    return Status::OK();
524
8.13k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
519
576k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
520
576k
    auto local_state = LocalStateType::create_unique(state, this);
521
576k
    RETURN_IF_ERROR(local_state->init(state, info));
522
576k
    state->emplace_local_state(operator_id(), std::move(local_state));
523
576k
    return Status::OK();
524
576k
}
525
526
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
527
                                                         RuntimeState* state)
528
1.91M
        : _parent(parent), _state(state) {}
529
530
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
531
2.57M
        : _num_rows_returned(0), _rows_returned_counter(nullptr), _parent(parent), _state(state) {}
532
533
template <typename SharedStateArg>
534
2.57M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
2.57M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
2.57M
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
2.57M
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
2.57M
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
2.57M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
2.57M
    _operator_profile->add_child(_common_profile.get(), true);
543
2.57M
    _operator_profile->add_child(_custom_profile.get(), true);
544
2.57M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
2.57M
    if constexpr (!is_fake_shared) {
546
1.19M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
699k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
699k
                                    .first.get()
549
699k
                                    ->template cast<SharedStateArg>();
550
551
699k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
699k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
699k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
699k
        } else if (info.shared_state) {
555
449k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
0
                DCHECK(false);
557
0
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
449k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
449k
            _dependency = _shared_state->create_source_dependency(
562
449k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
449k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
449k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
449k
        } else {
566
41.9k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
724
                DCHECK(false);
568
724
            }
569
41.9k
        }
570
1.19M
    }
571
572
2.57M
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
2.57M
    _rows_returned_counter =
577
2.57M
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
2.57M
    _blocks_returned_counter =
579
2.57M
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
2.57M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
2.57M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
2.57M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
2.57M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
2.57M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
2.57M
    _memory_used_counter =
586
2.57M
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
2.57M
    _common_profile->add_info_string("IsColocate",
588
2.57M
                                     std::to_string(_parent->is_colocated_operator()));
589
2.57M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
2.57M
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
2.57M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
2.57M
    return Status::OK();
593
2.57M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
133k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
133k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
133k
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
133k
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
133k
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
133k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
133k
    _operator_profile->add_child(_common_profile.get(), true);
543
133k
    _operator_profile->add_child(_custom_profile.get(), true);
544
133k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
133k
    if constexpr (!is_fake_shared) {
546
133k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
13.4k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
13.4k
                                    .first.get()
549
13.4k
                                    ->template cast<SharedStateArg>();
550
551
13.4k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
13.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
13.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
119k
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
118k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
118k
            _dependency = _shared_state->create_source_dependency(
562
118k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
118k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
118k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
118k
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
1.12k
        }
570
133k
    }
571
572
133k
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
133k
    _rows_returned_counter =
577
133k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
133k
    _blocks_returned_counter =
579
133k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
133k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
133k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
133k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
133k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
133k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
133k
    _memory_used_counter =
586
133k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
133k
    _common_profile->add_info_string("IsColocate",
588
133k
                                     std::to_string(_parent->is_colocated_operator()));
589
133k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
133k
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
133k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
133k
    return Status::OK();
593
133k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
1
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
1
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
1
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
1
    _operator_profile->add_child(_common_profile.get(), true);
543
1
    _operator_profile->add_child(_custom_profile.get(), true);
544
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
1
    if constexpr (!is_fake_shared) {
546
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
1
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
1
            _dependency = _shared_state->create_source_dependency(
562
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
1
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
0
        }
570
1
    }
571
572
1
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
1
    _rows_returned_counter =
577
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
1
    _blocks_returned_counter =
579
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
1
    _memory_used_counter =
586
1
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
1
    _common_profile->add_info_string("IsColocate",
588
1
                                     std::to_string(_parent->is_colocated_operator()));
589
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
1
    return Status::OK();
593
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
182k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
182k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
182k
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
182k
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
182k
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
182k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
182k
    _operator_profile->add_child(_common_profile.get(), true);
543
182k
    _operator_profile->add_child(_custom_profile.get(), true);
544
182k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
182k
    if constexpr (!is_fake_shared) {
546
182k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
182k
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
179k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
179k
            _dependency = _shared_state->create_source_dependency(
562
179k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
179k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
179k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
179k
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
3.01k
        }
570
182k
    }
571
572
182k
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
182k
    _rows_returned_counter =
577
182k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
182k
    _blocks_returned_counter =
579
182k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
182k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
182k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
182k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
182k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
182k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
182k
    _memory_used_counter =
586
182k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
182k
    _common_profile->add_info_string("IsColocate",
588
182k
                                     std::to_string(_parent->is_colocated_operator()));
589
182k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
182k
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
182k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
182k
    return Status::OK();
593
182k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
17
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
17
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
17
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
17
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
17
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
17
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
17
    _operator_profile->add_child(_common_profile.get(), true);
543
17
    _operator_profile->add_child(_custom_profile.get(), true);
544
17
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
17
    if constexpr (!is_fake_shared) {
546
17
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
17
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
17
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
17
            _dependency = _shared_state->create_source_dependency(
562
17
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
17
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
17
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
17
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
0
        }
570
17
    }
571
572
17
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
17
    _rows_returned_counter =
577
17
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
17
    _blocks_returned_counter =
579
17
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
17
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
17
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
17
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
17
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
17
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
17
    _memory_used_counter =
586
17
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
17
    _common_profile->add_info_string("IsColocate",
588
17
                                     std::to_string(_parent->is_colocated_operator()));
589
17
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
17
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
17
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
17
    return Status::OK();
593
17
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
5.53k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
5.53k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
5.53k
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
5.53k
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
5.53k
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
5.53k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
5.53k
    _operator_profile->add_child(_common_profile.get(), true);
543
5.53k
    _operator_profile->add_child(_custom_profile.get(), true);
544
5.53k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
5.53k
    if constexpr (!is_fake_shared) {
546
5.53k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
5.54k
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
5.54k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
5.54k
            _dependency = _shared_state->create_source_dependency(
562
5.54k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
5.54k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
5.54k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
18.4E
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
18.4E
        }
570
5.53k
    }
571
572
5.53k
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
5.53k
    _rows_returned_counter =
577
5.53k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
5.53k
    _blocks_returned_counter =
579
5.53k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
5.53k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
5.53k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
5.53k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
5.53k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
5.53k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
5.53k
    _memory_used_counter =
586
5.53k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
5.53k
    _common_profile->add_info_string("IsColocate",
588
5.53k
                                     std::to_string(_parent->is_colocated_operator()));
589
5.53k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
5.53k
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
5.53k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
5.53k
    return Status::OK();
593
5.53k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
8.63k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
8.63k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
8.63k
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
8.63k
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
8.63k
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
8.63k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
8.63k
    _operator_profile->add_child(_common_profile.get(), true);
543
8.63k
    _operator_profile->add_child(_custom_profile.get(), true);
544
8.63k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
8.63k
    if constexpr (!is_fake_shared) {
546
8.63k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
8.63k
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
8.61k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
8.61k
            _dependency = _shared_state->create_source_dependency(
562
8.61k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
8.61k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
8.61k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
8.61k
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
21
        }
570
8.63k
    }
571
572
8.63k
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
8.63k
    _rows_returned_counter =
577
8.63k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
8.63k
    _blocks_returned_counter =
579
8.63k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
8.63k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
8.63k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
8.63k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
8.63k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
8.63k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
8.63k
    _memory_used_counter =
586
8.63k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
8.63k
    _common_profile->add_info_string("IsColocate",
588
8.63k
                                     std::to_string(_parent->is_colocated_operator()));
589
8.63k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
8.63k
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
8.63k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
8.63k
    return Status::OK();
593
8.63k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
122k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
122k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
122k
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
122k
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
122k
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
122k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
122k
    _operator_profile->add_child(_common_profile.get(), true);
543
122k
    _operator_profile->add_child(_custom_profile.get(), true);
544
122k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
122k
    if constexpr (!is_fake_shared) {
546
122k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
122k
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
121k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
121k
            _dependency = _shared_state->create_source_dependency(
562
121k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
121k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
121k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
121k
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
913
        }
570
122k
    }
571
572
122k
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
122k
    _rows_returned_counter =
577
122k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
122k
    _blocks_returned_counter =
579
122k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
122k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
122k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
122k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
122k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
122k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
122k
    _memory_used_counter =
586
122k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
122k
    _common_profile->add_info_string("IsColocate",
588
122k
                                     std::to_string(_parent->is_colocated_operator()));
589
122k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
122k
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
122k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
122k
    return Status::OK();
593
122k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
344
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
344
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
344
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
344
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
344
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
344
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
344
    _operator_profile->add_child(_common_profile.get(), true);
543
344
    _operator_profile->add_child(_custom_profile.get(), true);
544
344
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
344
    if constexpr (!is_fake_shared) {
546
344
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
344
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
344
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
344
            _dependency = _shared_state->create_source_dependency(
562
344
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
344
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
344
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
344
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
0
        }
570
344
    }
571
572
344
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
344
    _rows_returned_counter =
577
344
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
344
    _blocks_returned_counter =
579
344
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
344
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
344
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
344
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
344
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
344
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
344
    _memory_used_counter =
586
344
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
344
    _common_profile->add_info_string("IsColocate",
588
344
                                     std::to_string(_parent->is_colocated_operator()));
589
344
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
344
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
344
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
344
    return Status::OK();
593
344
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
1.38M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
1.38M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
1.38M
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
1.38M
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
1.38M
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
1.38M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
1.38M
    _operator_profile->add_child(_common_profile.get(), true);
543
1.38M
    _operator_profile->add_child(_custom_profile.get(), true);
544
1.38M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
    if constexpr (!is_fake_shared) {
546
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
                                    .first.get()
549
                                    ->template cast<SharedStateArg>();
550
551
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
            _dependency = _shared_state->create_source_dependency(
562
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
        }
570
    }
571
572
1.38M
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
1.38M
    _rows_returned_counter =
577
1.38M
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
1.38M
    _blocks_returned_counter =
579
1.38M
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
1.38M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
1.38M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
1.38M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
1.38M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
1.38M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
1.38M
    _memory_used_counter =
586
1.38M
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
1.38M
    _common_profile->add_info_string("IsColocate",
588
1.38M
                                     std::to_string(_parent->is_colocated_operator()));
589
1.38M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
1.38M
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
1.38M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
1.38M
    return Status::OK();
593
1.38M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
39.2k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
39.2k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
39.2k
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
39.2k
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
39.2k
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
39.2k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
39.2k
    _operator_profile->add_child(_common_profile.get(), true);
543
39.2k
    _operator_profile->add_child(_custom_profile.get(), true);
544
39.2k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
39.2k
    if constexpr (!is_fake_shared) {
546
39.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
39.2k
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
3.07k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
3.07k
            _dependency = _shared_state->create_source_dependency(
562
3.07k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
3.07k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
3.07k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
36.1k
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
36.1k
        }
570
39.2k
    }
571
572
39.2k
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
39.2k
    _rows_returned_counter =
577
39.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
39.2k
    _blocks_returned_counter =
579
39.2k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
39.2k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
39.2k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
39.2k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
39.2k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
39.2k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
39.2k
    _memory_used_counter =
586
39.2k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
39.2k
    _common_profile->add_info_string("IsColocate",
588
39.2k
                                     std::to_string(_parent->is_colocated_operator()));
589
39.2k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
39.2k
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
39.2k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
39.2k
    return Status::OK();
593
39.2k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
367
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
367
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
367
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
367
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
367
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
367
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
367
    _operator_profile->add_child(_common_profile.get(), true);
543
367
    _operator_profile->add_child(_custom_profile.get(), true);
544
367
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
367
    if constexpr (!is_fake_shared) {
546
367
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
367
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
366
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
366
            _dependency = _shared_state->create_source_dependency(
562
366
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
366
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
366
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
366
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
1
        }
570
367
    }
571
572
367
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
367
    _rows_returned_counter =
577
367
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
367
    _blocks_returned_counter =
579
367
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
367
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
367
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
367
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
367
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
367
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
367
    _memory_used_counter =
586
367
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
367
    _common_profile->add_info_string("IsColocate",
588
367
                                     std::to_string(_parent->is_colocated_operator()));
589
367
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
367
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
367
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
367
    return Status::OK();
593
367
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
6.32k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
6.32k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
6.32k
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
6.32k
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
6.32k
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
6.32k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
6.32k
    _operator_profile->add_child(_common_profile.get(), true);
543
6.32k
    _operator_profile->add_child(_custom_profile.get(), true);
544
6.32k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
6.32k
    if constexpr (!is_fake_shared) {
546
6.32k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
6.32k
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
6.31k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
6.31k
            _dependency = _shared_state->create_source_dependency(
562
6.31k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
6.31k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
6.31k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
6.31k
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
12
        }
570
6.32k
    }
571
572
6.32k
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
6.32k
    _rows_returned_counter =
577
6.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
6.32k
    _blocks_returned_counter =
579
6.32k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
6.32k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
6.32k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
6.32k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
6.32k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
6.32k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
6.32k
    _memory_used_counter =
586
6.32k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
6.32k
    _common_profile->add_info_string("IsColocate",
588
6.32k
                                     std::to_string(_parent->is_colocated_operator()));
589
6.32k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
6.32k
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
6.32k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
6.32k
    return Status::OK();
593
6.32k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
435
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
435
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
435
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
435
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
435
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
435
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
435
    _operator_profile->add_child(_common_profile.get(), true);
543
435
    _operator_profile->add_child(_custom_profile.get(), true);
544
435
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
435
    if constexpr (!is_fake_shared) {
546
435
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
435
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
435
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
435
            _dependency = _shared_state->create_source_dependency(
562
435
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
435
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
435
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
435
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
0
        }
570
435
    }
571
572
435
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
435
    _rows_returned_counter =
577
435
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
435
    _blocks_returned_counter =
579
435
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
435
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
435
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
435
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
435
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
435
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
435
    _memory_used_counter =
586
435
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
435
    _common_profile->add_info_string("IsColocate",
588
435
                                     std::to_string(_parent->is_colocated_operator()));
589
435
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
435
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
435
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
435
    return Status::OK();
593
435
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
4.75k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
4.75k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
4.75k
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
4.75k
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
4.75k
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
4.75k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
4.75k
    _operator_profile->add_child(_common_profile.get(), true);
543
4.75k
    _operator_profile->add_child(_custom_profile.get(), true);
544
4.75k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
4.75k
    if constexpr (!is_fake_shared) {
546
4.75k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
4.75k
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
4.74k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
4.74k
            _dependency = _shared_state->create_source_dependency(
562
4.74k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
4.74k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
4.74k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
4.74k
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
17
        }
570
4.75k
    }
571
572
4.75k
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
4.75k
    _rows_returned_counter =
577
4.75k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
4.75k
    _blocks_returned_counter =
579
4.75k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
4.75k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
4.75k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
4.75k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
4.75k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
4.75k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
4.75k
    _memory_used_counter =
586
4.75k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
4.75k
    _common_profile->add_info_string("IsColocate",
588
4.75k
                                     std::to_string(_parent->is_colocated_operator()));
589
4.75k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
4.75k
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
4.75k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
4.75k
    return Status::OK();
593
4.75k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
686k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
686k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
686k
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
686k
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
686k
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
686k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
686k
    _operator_profile->add_child(_common_profile.get(), true);
543
686k
    _operator_profile->add_child(_custom_profile.get(), true);
544
686k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
686k
    if constexpr (!is_fake_shared) {
546
686k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
685k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
685k
                                    .first.get()
549
685k
                                    ->template cast<SharedStateArg>();
550
551
685k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
685k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
685k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
685k
        } else if (info.shared_state) {
555
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
0
                DCHECK(false);
557
0
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
0
            _dependency = _shared_state->create_source_dependency(
562
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
724
        } else {
566
724
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
724
                DCHECK(false);
568
724
            }
569
724
        }
570
686k
    }
571
572
686k
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
686k
    _rows_returned_counter =
577
686k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
686k
    _blocks_returned_counter =
579
686k
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
686k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
686k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
686k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
686k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
686k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
686k
    _memory_used_counter =
586
686k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
686k
    _common_profile->add_info_string("IsColocate",
588
686k
                                     std::to_string(_parent->is_colocated_operator()));
589
686k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
686k
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
686k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
686k
    return Status::OK();
593
686k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
534
150
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
535
150
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
536
150
    _common_profile.reset(new RuntimeProfile("CommonCounters"));
537
150
    _custom_profile.reset(new RuntimeProfile("CustomCounters"));
538
150
    _operator_profile->set_metadata(_parent->node_id());
539
    // indent is false so that source operator will have same
540
    // indentation_level with its parent operator.
541
150
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
542
150
    _operator_profile->add_child(_common_profile.get(), true);
543
150
    _operator_profile->add_child(_custom_profile.get(), true);
544
150
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
545
150
    if constexpr (!is_fake_shared) {
546
150
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
547
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
548
0
                                    .first.get()
549
0
                                    ->template cast<SharedStateArg>();
550
551
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
552
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
553
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
554
150
        } else if (info.shared_state) {
555
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
556
                DCHECK(false);
557
            }
558
            // For UnionSourceOperator without children, there is no shared state.
559
150
            _shared_state = info.shared_state->template cast<SharedStateArg>();
560
561
150
            _dependency = _shared_state->create_source_dependency(
562
150
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
563
150
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
564
150
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
565
150
        } else {
566
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
567
                DCHECK(false);
568
            }
569
0
        }
570
150
    }
571
572
150
    if (must_set_shared_state() && _shared_state == nullptr) {
573
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
574
0
    }
575
576
150
    _rows_returned_counter =
577
150
            ADD_COUNTER_WITH_LEVEL(_common_profile, "RowsProduced", TUnit::UNIT, 1);
578
150
    _blocks_returned_counter =
579
150
            ADD_COUNTER_WITH_LEVEL(_common_profile, "BlocksProduced", TUnit::UNIT, 1);
580
150
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ProjectionTime", 2);
581
150
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
582
150
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
583
150
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
584
150
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
585
150
    _memory_used_counter =
586
150
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
587
150
    _common_profile->add_info_string("IsColocate",
588
150
                                     std::to_string(_parent->is_colocated_operator()));
589
150
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
590
150
    _common_profile->add_info_string("FollowedByShuffledOperator",
591
150
                                     std::to_string(_parent->followed_by_shuffled_operator()));
592
150
    return Status::OK();
593
150
}
594
595
template <typename SharedStateArg>
596
2.58M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
2.58M
    _conjuncts.resize(_parent->_conjuncts.size());
598
2.58M
    _projections.resize(_parent->_projections.size());
599
2.91M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
326k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
326k
    }
602
5.09M
    for (size_t i = 0; i < _projections.size(); i++) {
603
2.50M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
2.50M
    }
605
2.58M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
2.59M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
6.17k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
40.6k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
34.4k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
34.4k
                    state, _intermediate_projections[i][j]));
611
34.4k
        }
612
6.17k
    }
613
2.58M
    return Status::OK();
614
2.58M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
133k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
133k
    _conjuncts.resize(_parent->_conjuncts.size());
598
133k
    _projections.resize(_parent->_projections.size());
599
134k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
1.32k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
1.32k
    }
602
684k
    for (size_t i = 0; i < _projections.size(); i++) {
603
551k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
551k
    }
605
133k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
134k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
687
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
6.20k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
5.51k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
5.51k
                    state, _intermediate_projections[i][j]));
611
5.51k
        }
612
687
    }
613
133k
    return Status::OK();
614
133k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
1
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
1
    _conjuncts.resize(_parent->_conjuncts.size());
598
1
    _projections.resize(_parent->_projections.size());
599
1
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
0
    }
602
1
    for (size_t i = 0; i < _projections.size(); i++) {
603
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
0
    }
605
1
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
1
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
0
                    state, _intermediate_projections[i][j]));
611
0
        }
612
0
    }
613
1
    return Status::OK();
614
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
184k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
184k
    _conjuncts.resize(_parent->_conjuncts.size());
598
184k
    _projections.resize(_parent->_projections.size());
599
184k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
0
    }
602
202k
    for (size_t i = 0; i < _projections.size(); i++) {
603
18.7k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
18.7k
    }
605
184k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
184k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
0
                    state, _intermediate_projections[i][j]));
611
0
        }
612
0
    }
613
184k
    return Status::OK();
614
184k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
17
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
17
    _conjuncts.resize(_parent->_conjuncts.size());
598
17
    _projections.resize(_parent->_projections.size());
599
17
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
0
    }
602
17
    for (size_t i = 0; i < _projections.size(); i++) {
603
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
0
    }
605
17
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
17
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
0
                    state, _intermediate_projections[i][j]));
611
0
        }
612
0
    }
613
17
    return Status::OK();
614
17
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
5.58k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
5.58k
    _conjuncts.resize(_parent->_conjuncts.size());
598
5.58k
    _projections.resize(_parent->_projections.size());
599
5.68k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
102
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
102
    }
602
25.8k
    for (size_t i = 0; i < _projections.size(); i++) {
603
20.2k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
20.2k
    }
605
5.58k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
5.60k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
22
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
195
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
173
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
173
                    state, _intermediate_projections[i][j]));
611
173
        }
612
22
    }
613
5.58k
    return Status::OK();
614
5.58k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
8.64k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
8.64k
    _conjuncts.resize(_parent->_conjuncts.size());
598
8.64k
    _projections.resize(_parent->_projections.size());
599
9.41k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
768
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
768
    }
602
23.0k
    for (size_t i = 0; i < _projections.size(); i++) {
603
14.3k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
14.3k
    }
605
8.64k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
8.84k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
193
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
1.47k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
1.28k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
1.28k
                    state, _intermediate_projections[i][j]));
611
1.28k
        }
612
193
    }
613
8.64k
    return Status::OK();
614
8.64k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
122k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
122k
    _conjuncts.resize(_parent->_conjuncts.size());
598
122k
    _projections.resize(_parent->_projections.size());
599
125k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
2.37k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
2.37k
    }
602
439k
    for (size_t i = 0; i < _projections.size(); i++) {
603
316k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
316k
    }
605
122k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
123k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
171
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
1.47k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
1.30k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
1.30k
                    state, _intermediate_projections[i][j]));
611
1.30k
        }
612
171
    }
613
122k
    return Status::OK();
614
122k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
348
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
348
    _conjuncts.resize(_parent->_conjuncts.size());
598
348
    _projections.resize(_parent->_projections.size());
599
348
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
0
    }
602
854
    for (size_t i = 0; i < _projections.size(); i++) {
603
506
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
506
    }
605
348
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
348
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
0
                    state, _intermediate_projections[i][j]));
611
0
        }
612
0
    }
613
348
    return Status::OK();
614
348
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
1.39M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
1.39M
    _conjuncts.resize(_parent->_conjuncts.size());
598
1.39M
    _projections.resize(_parent->_projections.size());
599
1.71M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
321k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
321k
    }
602
2.88M
    for (size_t i = 0; i < _projections.size(); i++) {
603
1.49M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
1.49M
    }
605
1.39M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
1.39M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
5.10k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
31.3k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
26.2k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
26.2k
                    state, _intermediate_projections[i][j]));
611
26.2k
        }
612
5.10k
    }
613
1.39M
    return Status::OK();
614
1.39M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
39.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
39.3k
    _conjuncts.resize(_parent->_conjuncts.size());
598
39.3k
    _projections.resize(_parent->_projections.size());
599
39.3k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
0
    }
602
132k
    for (size_t i = 0; i < _projections.size(); i++) {
603
93.2k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
93.2k
    }
605
39.3k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
39.3k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
0
                    state, _intermediate_projections[i][j]));
611
0
        }
612
0
    }
613
39.3k
    return Status::OK();
614
39.3k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
369
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
369
    _conjuncts.resize(_parent->_conjuncts.size());
598
369
    _projections.resize(_parent->_projections.size());
599
369
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
0
    }
602
369
    for (size_t i = 0; i < _projections.size(); i++) {
603
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
0
    }
605
369
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
369
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
0
                    state, _intermediate_projections[i][j]));
611
0
        }
612
0
    }
613
369
    return Status::OK();
614
369
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
6.31k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
6.31k
    _conjuncts.resize(_parent->_conjuncts.size());
598
6.31k
    _projections.resize(_parent->_projections.size());
599
6.88k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
566
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
566
    }
602
6.31k
    for (size_t i = 0; i < _projections.size(); i++) {
603
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
0
    }
605
6.31k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
6.31k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
0
                    state, _intermediate_projections[i][j]));
611
0
        }
612
0
    }
613
6.31k
    return Status::OK();
614
6.31k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
435
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
435
    _conjuncts.resize(_parent->_conjuncts.size());
598
435
    _projections.resize(_parent->_projections.size());
599
435
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
0
    }
602
435
    for (size_t i = 0; i < _projections.size(); i++) {
603
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
0
    }
605
435
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
435
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
0
                    state, _intermediate_projections[i][j]));
611
0
        }
612
0
    }
613
435
    return Status::OK();
614
435
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
4.76k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
4.76k
    _conjuncts.resize(_parent->_conjuncts.size());
598
4.76k
    _projections.resize(_parent->_projections.size());
599
4.76k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
0
    }
602
4.76k
    for (size_t i = 0; i < _projections.size(); i++) {
603
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
0
    }
605
4.76k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
4.76k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
0
                    state, _intermediate_projections[i][j]));
611
0
        }
612
0
    }
613
4.76k
    return Status::OK();
614
4.76k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
691k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
691k
    _conjuncts.resize(_parent->_conjuncts.size());
598
691k
    _projections.resize(_parent->_projections.size());
599
691k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
0
    }
602
691k
    for (size_t i = 0; i < _projections.size(); i++) {
603
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
0
    }
605
691k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
691k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
0
                    state, _intermediate_projections[i][j]));
611
0
        }
612
0
    }
613
691k
    return Status::OK();
614
691k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
596
150
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
597
150
    _conjuncts.resize(_parent->_conjuncts.size());
598
150
    _projections.resize(_parent->_projections.size());
599
157
    for (size_t i = 0; i < _conjuncts.size(); i++) {
600
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
601
7
    }
602
443
    for (size_t i = 0; i < _projections.size(); i++) {
603
293
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
604
293
    }
605
150
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
606
151
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
607
1
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
608
3
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
609
2
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
610
2
                    state, _intermediate_projections[i][j]));
611
2
        }
612
1
    }
613
150
    return Status::OK();
614
150
}
615
616
template <typename SharedStateArg>
617
8.56k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
8.56k
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
8.56k
    _terminated = true;
622
8.56k
    return Status::OK();
623
8.56k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
1.39k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
1.39k
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
1.39k
    _terminated = true;
622
1.39k
    return Status::OK();
623
1.39k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
177
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
177
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
177
    _terminated = true;
622
177
    return Status::OK();
623
177
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
200
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
200
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
200
    _terminated = true;
622
200
    return Status::OK();
623
200
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
3
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
3
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
3
    _terminated = true;
622
3
    return Status::OK();
623
3
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
1.13k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
1.13k
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
1.13k
    _terminated = true;
622
1.13k
    return Status::OK();
623
1.13k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
4.98k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
4.98k
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
4.98k
    _terminated = true;
622
4.98k
    return Status::OK();
623
4.98k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
8
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
8
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
8
    _terminated = true;
622
8
    return Status::OK();
623
8
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
11
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
11
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
11
    _terminated = true;
622
11
    return Status::OK();
623
11
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
2
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
2
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
2
    _terminated = true;
622
2
    return Status::OK();
623
2
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
643
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
643
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
643
    _terminated = true;
622
643
    return Status::OK();
623
643
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
617
15
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
618
15
    if (_terminated) {
619
0
        return Status::OK();
620
0
    }
621
15
    _terminated = true;
622
15
    return Status::OK();
623
15
}
624
625
template <typename SharedStateArg>
626
2.80M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
2.80M
    if (_closed) {
628
212k
        return Status::OK();
629
212k
    }
630
2.59M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
1.19M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
1.19M
    }
633
2.59M
    _closed = true;
634
2.59M
    return Status::OK();
635
2.80M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
133k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
133k
    if (_closed) {
628
0
        return Status::OK();
629
0
    }
630
133k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
133k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
133k
    }
633
133k
    _closed = true;
634
133k
    return Status::OK();
635
133k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
1
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
1
    if (_closed) {
628
0
        return Status::OK();
629
0
    }
630
1
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
1
    }
633
1
    _closed = true;
634
1
    return Status::OK();
635
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
366k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
366k
    if (_closed) {
628
183k
        return Status::OK();
629
183k
    }
630
183k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
183k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
183k
    }
633
183k
    _closed = true;
634
183k
    return Status::OK();
635
366k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
17
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
17
    if (_closed) {
628
0
        return Status::OK();
629
0
    }
630
17
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
17
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
17
    }
633
17
    _closed = true;
634
17
    return Status::OK();
635
17
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
5.58k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
5.58k
    if (_closed) {
628
0
        return Status::OK();
629
0
    }
630
5.58k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
5.58k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
5.58k
    }
633
5.58k
    _closed = true;
634
5.58k
    return Status::OK();
635
5.58k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
17.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
17.3k
    if (_closed) {
628
8.76k
        return Status::OK();
629
8.76k
    }
630
8.62k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
8.62k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
8.62k
    }
633
8.62k
    _closed = true;
634
8.62k
    return Status::OK();
635
17.3k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
122k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
122k
    if (_closed) {
628
0
        return Status::OK();
629
0
    }
630
122k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
122k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
122k
    }
633
122k
    _closed = true;
634
122k
    return Status::OK();
635
122k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
343
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
343
    if (_closed) {
628
0
        return Status::OK();
629
0
    }
630
343
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
343
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
343
    }
633
343
    _closed = true;
634
343
    return Status::OK();
635
343
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
1.40M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
1.40M
    if (_closed) {
628
14.9k
        return Status::OK();
629
14.9k
    }
630
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
    }
633
1.39M
    _closed = true;
634
1.39M
    return Status::OK();
635
1.40M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
39.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
39.3k
    if (_closed) {
628
0
        return Status::OK();
629
0
    }
630
39.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
39.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
39.3k
    }
633
39.3k
    _closed = true;
634
39.3k
    return Status::OK();
635
39.3k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
731
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
731
    if (_closed) {
628
366
        return Status::OK();
629
366
    }
630
365
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
365
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
365
    }
633
365
    _closed = true;
634
365
    return Status::OK();
635
731
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
6.29k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
6.29k
    if (_closed) {
628
0
        return Status::OK();
629
0
    }
630
6.29k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
6.29k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
6.29k
    }
633
6.29k
    _closed = true;
634
6.29k
    return Status::OK();
635
6.29k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
661
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
661
    if (_closed) {
628
333
        return Status::OK();
629
333
    }
630
328
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
328
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
328
    }
633
328
    _closed = true;
634
328
    return Status::OK();
635
661
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
9.58k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
9.58k
    if (_closed) {
628
4.82k
        return Status::OK();
629
4.82k
    }
630
4.75k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
4.75k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
4.75k
    }
633
4.75k
    _closed = true;
634
4.75k
    return Status::OK();
635
9.58k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
692k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
692k
    if (_closed) {
628
0
        return Status::OK();
629
0
    }
630
692k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
692k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
692k
    }
633
692k
    _closed = true;
634
692k
    return Status::OK();
635
692k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
626
306
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
627
306
    if (_closed) {
628
157
        return Status::OK();
629
157
    }
630
149
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
631
149
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
632
149
    }
633
149
    _closed = true;
634
149
    return Status::OK();
635
306
}
636
637
template <typename SharedState>
638
1.92M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
1.92M
    _operator_profile =
641
1.92M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
1.92M
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
1.92M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
1.92M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
1.92M
    _operator_profile->add_child(_common_profile, true);
650
1.92M
    _operator_profile->add_child(_custom_profile, true);
651
652
1.92M
    _operator_profile->set_metadata(_parent->node_id());
653
1.92M
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
1.92M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
1.92M
    if constexpr (!is_fake_shared) {
656
1.30M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
1.30M
            info.shared_state_map.end()) {
658
325k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
310k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
310k
            }
661
325k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
325k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
325k
                                                  ? 0
664
325k
                                                  : info.task_idx]
665
325k
                                  .get();
666
325k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
980k
        } else {
668
980k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
583
                DCHECK(false);
670
583
            }
671
980k
            _shared_state = info.shared_state->template cast<SharedState>();
672
980k
            _dependency = _shared_state->create_sink_dependency(
673
980k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
980k
        }
675
1.30M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
1.30M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
1.30M
    }
678
679
1.92M
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
1.92M
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
1.92M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
1.92M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
1.92M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
1.92M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
1.92M
    _memory_used_counter =
689
1.92M
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
1.92M
    _common_profile->add_info_string("IsColocate",
691
1.92M
                                     std::to_string(_parent->is_colocated_operator()));
692
1.92M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
1.92M
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
1.92M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
1.92M
    return Status::OK();
696
1.92M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
181k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
181k
    _operator_profile =
641
181k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
181k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
181k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
181k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
181k
    _operator_profile->add_child(_common_profile, true);
650
181k
    _operator_profile->add_child(_custom_profile, true);
651
652
181k
    _operator_profile->set_metadata(_parent->node_id());
653
181k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
181k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
181k
    if constexpr (!is_fake_shared) {
656
181k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
181k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
13.5k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
13.5k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
13.5k
                                                  ? 0
664
13.5k
                                                  : info.task_idx]
665
13.5k
                                  .get();
666
13.5k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
167k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
167k
            _shared_state = info.shared_state->template cast<SharedState>();
672
167k
            _dependency = _shared_state->create_sink_dependency(
673
167k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
167k
        }
675
181k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
181k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
181k
    }
678
679
181k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
181k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
181k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
181k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
181k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
181k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
181k
    _memory_used_counter =
689
181k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
181k
    _common_profile->add_info_string("IsColocate",
691
181k
                                     std::to_string(_parent->is_colocated_operator()));
692
181k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
181k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
181k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
181k
    return Status::OK();
696
181k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
2
    _operator_profile =
641
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
2
    _operator_profile->add_child(_common_profile, true);
650
2
    _operator_profile->add_child(_custom_profile, true);
651
652
2
    _operator_profile->set_metadata(_parent->node_id());
653
2
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
2
    if constexpr (!is_fake_shared) {
656
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
2
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
2
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
2
            _shared_state = info.shared_state->template cast<SharedState>();
672
2
            _dependency = _shared_state->create_sink_dependency(
673
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
2
        }
675
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
2
    }
678
679
2
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
2
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
2
    _memory_used_counter =
689
2
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
2
    _common_profile->add_info_string("IsColocate",
691
2
                                     std::to_string(_parent->is_colocated_operator()));
692
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
2
    return Status::OK();
696
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
183k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
183k
    _operator_profile =
641
183k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
183k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
183k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
183k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
183k
    _operator_profile->add_child(_common_profile, true);
650
183k
    _operator_profile->add_child(_custom_profile, true);
651
652
183k
    _operator_profile->set_metadata(_parent->node_id());
653
183k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
183k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
183k
    if constexpr (!is_fake_shared) {
656
183k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
183k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
183k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
183k
            _shared_state = info.shared_state->template cast<SharedState>();
672
183k
            _dependency = _shared_state->create_sink_dependency(
673
183k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
183k
        }
675
183k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
183k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
183k
    }
678
679
183k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
183k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
183k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
183k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
183k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
183k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
183k
    _memory_used_counter =
689
183k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
183k
    _common_profile->add_info_string("IsColocate",
691
183k
                                     std::to_string(_parent->is_colocated_operator()));
692
183k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
183k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
183k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
183k
    return Status::OK();
696
183k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
20
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
20
    _operator_profile =
641
20
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
20
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
20
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
20
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
20
    _operator_profile->add_child(_common_profile, true);
650
20
    _operator_profile->add_child(_custom_profile, true);
651
652
20
    _operator_profile->set_metadata(_parent->node_id());
653
20
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
20
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
20
    if constexpr (!is_fake_shared) {
656
20
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
20
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
20
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
20
            _shared_state = info.shared_state->template cast<SharedState>();
672
20
            _dependency = _shared_state->create_sink_dependency(
673
20
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
20
        }
675
20
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
20
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
20
    }
678
679
20
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
20
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
20
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
20
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
20
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
20
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
20
    _memory_used_counter =
689
20
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
20
    _common_profile->add_info_string("IsColocate",
691
20
                                     std::to_string(_parent->is_colocated_operator()));
692
20
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
20
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
20
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
20
    return Status::OK();
696
20
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
5.58k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
5.58k
    _operator_profile =
641
5.58k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
5.58k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
5.58k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
5.58k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
5.58k
    _operator_profile->add_child(_common_profile, true);
650
5.58k
    _operator_profile->add_child(_custom_profile, true);
651
652
5.58k
    _operator_profile->set_metadata(_parent->node_id());
653
5.58k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
5.58k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
5.58k
    if constexpr (!is_fake_shared) {
656
5.58k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
5.58k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
5.58k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
5.58k
            _shared_state = info.shared_state->template cast<SharedState>();
672
5.58k
            _dependency = _shared_state->create_sink_dependency(
673
5.58k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
5.58k
        }
675
5.58k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
5.58k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
5.58k
    }
678
679
5.58k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
5.58k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
5.58k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
5.58k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
5.58k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
5.58k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
5.58k
    _memory_used_counter =
689
5.58k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
5.58k
    _common_profile->add_info_string("IsColocate",
691
5.58k
                                     std::to_string(_parent->is_colocated_operator()));
692
5.58k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
5.58k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
5.58k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
5.58k
    return Status::OK();
696
5.58k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
8.64k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
8.64k
    _operator_profile =
641
8.64k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
8.64k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
8.64k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
8.64k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
8.64k
    _operator_profile->add_child(_common_profile, true);
650
8.64k
    _operator_profile->add_child(_custom_profile, true);
651
652
8.64k
    _operator_profile->set_metadata(_parent->node_id());
653
8.64k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
8.64k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
8.64k
    if constexpr (!is_fake_shared) {
656
8.64k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
8.64k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
8.64k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
8.64k
            _shared_state = info.shared_state->template cast<SharedState>();
672
8.64k
            _dependency = _shared_state->create_sink_dependency(
673
8.64k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
8.64k
        }
675
8.64k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
8.64k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
8.64k
    }
678
679
8.64k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
8.64k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
8.64k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
8.64k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
8.64k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
8.64k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
8.64k
    _memory_used_counter =
689
8.64k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
8.64k
    _common_profile->add_info_string("IsColocate",
691
8.64k
                                     std::to_string(_parent->is_colocated_operator()));
692
8.64k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
8.64k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
8.64k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
8.64k
    return Status::OK();
696
8.64k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
122k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
122k
    _operator_profile =
641
122k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
122k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
122k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
122k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
122k
    _operator_profile->add_child(_common_profile, true);
650
122k
    _operator_profile->add_child(_custom_profile, true);
651
652
122k
    _operator_profile->set_metadata(_parent->node_id());
653
122k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
122k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
122k
    if constexpr (!is_fake_shared) {
656
122k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
122k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
122k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
122k
            _shared_state = info.shared_state->template cast<SharedState>();
672
122k
            _dependency = _shared_state->create_sink_dependency(
673
122k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
122k
        }
675
122k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
122k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
122k
    }
678
679
122k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
122k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
122k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
122k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
122k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
122k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
122k
    _memory_used_counter =
689
122k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
122k
    _common_profile->add_info_string("IsColocate",
691
122k
                                     std::to_string(_parent->is_colocated_operator()));
692
122k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
122k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
122k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
122k
    return Status::OK();
696
122k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
350
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
350
    _operator_profile =
641
350
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
350
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
350
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
350
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
350
    _operator_profile->add_child(_common_profile, true);
650
350
    _operator_profile->add_child(_custom_profile, true);
651
652
350
    _operator_profile->set_metadata(_parent->node_id());
653
350
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
350
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
350
    if constexpr (!is_fake_shared) {
656
350
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
350
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
350
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
350
            _shared_state = info.shared_state->template cast<SharedState>();
672
350
            _dependency = _shared_state->create_sink_dependency(
673
350
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
350
        }
675
350
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
350
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
350
    }
678
679
350
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
350
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
350
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
350
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
350
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
350
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
350
    _memory_used_counter =
689
350
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
350
    _common_profile->add_info_string("IsColocate",
691
350
                                     std::to_string(_parent->is_colocated_operator()));
692
350
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
350
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
350
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
350
    return Status::OK();
696
350
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
616k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
616k
    _operator_profile =
641
616k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
616k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
616k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
616k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
616k
    _operator_profile->add_child(_common_profile, true);
650
616k
    _operator_profile->add_child(_custom_profile, true);
651
652
616k
    _operator_profile->set_metadata(_parent->node_id());
653
616k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
616k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
    if constexpr (!is_fake_shared) {
656
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
                                                  ? 0
664
                                                  : info.task_idx]
665
                                  .get();
666
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
            _shared_state = info.shared_state->template cast<SharedState>();
672
            _dependency = _shared_state->create_sink_dependency(
673
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
        }
675
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
    }
678
679
616k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
616k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
616k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
616k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
616k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
616k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
616k
    _memory_used_counter =
689
616k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
616k
    _common_profile->add_info_string("IsColocate",
691
616k
                                     std::to_string(_parent->is_colocated_operator()));
692
616k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
616k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
616k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
616k
    return Status::OK();
696
616k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
6.52k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
6.52k
    _operator_profile =
641
6.52k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
6.52k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
6.52k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
6.52k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
6.52k
    _operator_profile->add_child(_common_profile, true);
650
6.52k
    _operator_profile->add_child(_custom_profile, true);
651
652
6.52k
    _operator_profile->set_metadata(_parent->node_id());
653
6.52k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
6.52k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
6.52k
    if constexpr (!is_fake_shared) {
656
6.52k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
6.52k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
6.52k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
6.52k
            _shared_state = info.shared_state->template cast<SharedState>();
672
6.52k
            _dependency = _shared_state->create_sink_dependency(
673
6.52k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
6.52k
        }
675
6.52k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
6.52k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
6.52k
    }
678
679
6.52k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
6.52k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
6.52k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
6.52k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
6.52k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
6.52k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
6.52k
    _memory_used_counter =
689
6.52k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
6.52k
    _common_profile->add_info_string("IsColocate",
691
6.52k
                                     std::to_string(_parent->is_colocated_operator()));
692
6.52k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
6.52k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
6.52k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
6.52k
    return Status::OK();
696
6.52k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
435
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
435
    _operator_profile =
641
435
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
435
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
435
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
435
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
435
    _operator_profile->add_child(_common_profile, true);
650
435
    _operator_profile->add_child(_custom_profile, true);
651
652
435
    _operator_profile->set_metadata(_parent->node_id());
653
435
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
435
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
435
    if constexpr (!is_fake_shared) {
656
435
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
435
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
435
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
435
            _shared_state = info.shared_state->template cast<SharedState>();
672
435
            _dependency = _shared_state->create_sink_dependency(
673
435
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
435
        }
675
435
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
435
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
435
    }
678
679
435
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
435
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
435
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
435
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
435
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
435
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
435
    _memory_used_counter =
689
435
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
435
    _common_profile->add_info_string("IsColocate",
691
435
                                     std::to_string(_parent->is_colocated_operator()));
692
435
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
435
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
435
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
435
    return Status::OK();
696
435
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
2.37k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
2.37k
    _operator_profile =
641
2.37k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
2.37k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
2.37k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
2.37k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
2.37k
    _operator_profile->add_child(_common_profile, true);
650
2.37k
    _operator_profile->add_child(_custom_profile, true);
651
652
2.37k
    _operator_profile->set_metadata(_parent->node_id());
653
2.37k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
2.37k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
2.37k
    if constexpr (!is_fake_shared) {
656
2.37k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
2.37k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
2.37k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
2.37k
            _shared_state = info.shared_state->template cast<SharedState>();
672
2.37k
            _dependency = _shared_state->create_sink_dependency(
673
2.37k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
2.37k
        }
675
2.37k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
2.37k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
2.37k
    }
678
679
2.37k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
2.37k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
2.37k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
2.37k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
2.37k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
2.37k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
2.37k
    _memory_used_counter =
689
2.37k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
2.37k
    _common_profile->add_info_string("IsColocate",
691
2.37k
                                     std::to_string(_parent->is_colocated_operator()));
692
2.37k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
2.37k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
2.37k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
2.37k
    return Status::OK();
696
2.37k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
11.7k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
11.7k
    _operator_profile =
641
11.7k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
11.7k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
11.7k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
11.7k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
11.7k
    _operator_profile->add_child(_common_profile, true);
650
11.7k
    _operator_profile->add_child(_custom_profile, true);
651
652
11.7k
    _operator_profile->set_metadata(_parent->node_id());
653
11.7k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
11.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
11.7k
    if constexpr (!is_fake_shared) {
656
11.7k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
11.7k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
11.7k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
11.7k
            _shared_state = info.shared_state->template cast<SharedState>();
672
11.7k
            _dependency = _shared_state->create_sink_dependency(
673
11.7k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
11.7k
        }
675
11.7k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
11.7k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
11.7k
    }
678
679
11.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
11.7k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
11.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
11.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
11.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
11.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
11.7k
    _memory_used_counter =
689
11.7k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
11.7k
    _common_profile->add_info_string("IsColocate",
691
11.7k
                                     std::to_string(_parent->is_colocated_operator()));
692
11.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
11.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
11.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
11.7k
    return Status::OK();
696
11.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
311k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
311k
    _operator_profile =
641
311k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
311k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
311k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
311k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
311k
    _operator_profile->add_child(_common_profile, true);
650
311k
    _operator_profile->add_child(_custom_profile, true);
651
652
311k
    _operator_profile->set_metadata(_parent->node_id());
653
311k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
311k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
311k
    if constexpr (!is_fake_shared) {
656
311k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
311k
            info.shared_state_map.end()) {
658
310k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
310k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
310k
            }
661
310k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
310k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
310k
                                                  ? 0
664
310k
                                                  : info.task_idx]
665
310k
                                  .get();
666
310k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
310k
        } else {
668
583
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
583
                DCHECK(false);
670
583
            }
671
583
            _shared_state = info.shared_state->template cast<SharedState>();
672
583
            _dependency = _shared_state->create_sink_dependency(
673
583
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
583
        }
675
311k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
311k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
311k
    }
678
679
311k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
311k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
311k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
311k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
311k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
311k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
311k
    _memory_used_counter =
689
311k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
311k
    _common_profile->add_info_string("IsColocate",
691
311k
                                     std::to_string(_parent->is_colocated_operator()));
692
311k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
311k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
311k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
311k
    return Status::OK();
696
311k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
470k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
470k
    _operator_profile =
641
470k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
470k
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
470k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
470k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
470k
    _operator_profile->add_child(_common_profile, true);
650
470k
    _operator_profile->add_child(_custom_profile, true);
651
652
470k
    _operator_profile->set_metadata(_parent->node_id());
653
470k
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
470k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
470k
    if constexpr (!is_fake_shared) {
656
470k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
470k
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
759
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
759
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
759
                                                  ? 0
664
759
                                                  : info.task_idx]
665
759
                                  .get();
666
759
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
469k
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
469k
            _shared_state = info.shared_state->template cast<SharedState>();
672
469k
            _dependency = _shared_state->create_sink_dependency(
673
469k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
469k
        }
675
470k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
470k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
470k
    }
678
679
470k
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
470k
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
470k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
470k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
470k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
470k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
470k
    _memory_used_counter =
689
470k
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
470k
    _common_profile->add_info_string("IsColocate",
691
470k
                                     std::to_string(_parent->is_colocated_operator()));
692
470k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
470k
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
470k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
470k
    return Status::OK();
696
470k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
369
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
369
    _operator_profile =
641
369
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
369
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
369
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
369
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
369
    _operator_profile->add_child(_common_profile, true);
650
369
    _operator_profile->add_child(_custom_profile, true);
651
652
369
    _operator_profile->set_metadata(_parent->node_id());
653
369
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
369
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
369
    if constexpr (!is_fake_shared) {
656
369
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
369
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
369
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
369
            _shared_state = info.shared_state->template cast<SharedState>();
672
369
            _dependency = _shared_state->create_sink_dependency(
673
369
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
369
        }
675
369
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
369
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
369
    }
678
679
369
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
369
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
369
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
369
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
369
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
369
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
369
    _memory_used_counter =
689
369
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
369
    _common_profile->add_info_string("IsColocate",
691
369
                                     std::to_string(_parent->is_colocated_operator()));
692
369
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
369
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
369
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
369
    return Status::OK();
696
369
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
638
300
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
639
    // create profile
640
300
    _operator_profile =
641
300
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
642
300
    _common_profile = state->obj_pool()->add(new RuntimeProfile("CommonCounters"));
643
300
    _custom_profile = state->obj_pool()->add(new RuntimeProfile("CustomCounters"));
644
645
    // indentation is true
646
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
647
    // So we should set the indentation to true.
648
300
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
649
300
    _operator_profile->add_child(_common_profile, true);
650
300
    _operator_profile->add_child(_custom_profile, true);
651
652
300
    _operator_profile->set_metadata(_parent->node_id());
653
300
    _wait_for_finish_dependency_timer = ADD_TIMER(_common_profile, "PendingFinishDependency");
654
300
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
655
300
    if constexpr (!is_fake_shared) {
656
300
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
657
300
            info.shared_state_map.end()) {
658
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
659
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
660
            }
661
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
662
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
663
0
                                                  ? 0
664
0
                                                  : info.task_idx]
665
0
                                  .get();
666
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
667
300
        } else {
668
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
669
                DCHECK(false);
670
            }
671
300
            _shared_state = info.shared_state->template cast<SharedState>();
672
300
            _dependency = _shared_state->create_sink_dependency(
673
300
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
674
300
        }
675
300
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
676
300
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
677
300
    }
678
679
300
    if (must_set_shared_state() && _shared_state == nullptr) {
680
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
681
0
    }
682
683
300
    _rows_input_counter = ADD_COUNTER_WITH_LEVEL(_common_profile, "InputRows", TUnit::UNIT, 1);
684
300
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "InitTime", 2);
685
300
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "OpenTime", 2);
686
300
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "CloseTime", 2);
687
300
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, "ExecTime", 1);
688
300
    _memory_used_counter =
689
300
            _common_profile->AddHighWaterMarkCounter("MemoryUsage", TUnit::BYTES, "", 1);
690
300
    _common_profile->add_info_string("IsColocate",
691
300
                                     std::to_string(_parent->is_colocated_operator()));
692
300
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
693
300
    _common_profile->add_info_string("FollowedByShuffledOperator",
694
300
                                     std::to_string(_parent->followed_by_shuffled_operator()));
695
300
    return Status::OK();
696
300
}
697
698
template <typename SharedState>
699
1.92M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
1.92M
    if (_closed) {
701
2
        return Status::OK();
702
2
    }
703
1.92M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
1.30M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
1.30M
    }
706
1.92M
    _closed = true;
707
1.92M
    return Status::OK();
708
1.92M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
181k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
181k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
181k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
181k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
181k
    }
706
181k
    _closed = true;
707
181k
    return Status::OK();
708
181k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
1
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
1
    }
706
1
    _closed = true;
707
1
    return Status::OK();
708
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
183k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
183k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
183k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
183k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
183k
    }
706
183k
    _closed = true;
707
183k
    return Status::OK();
708
183k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
16
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
16
    if (_closed) {
701
2
        return Status::OK();
702
2
    }
703
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
14
    }
706
14
    _closed = true;
707
14
    return Status::OK();
708
16
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
5.56k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
5.56k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
5.56k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
5.56k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
5.56k
    }
706
5.56k
    _closed = true;
707
5.56k
    return Status::OK();
708
5.56k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
8.61k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
8.61k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
8.61k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
8.61k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
8.61k
    }
706
8.61k
    _closed = true;
707
8.61k
    return Status::OK();
708
8.61k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
122k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
122k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
122k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
122k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
122k
    }
706
122k
    _closed = true;
707
122k
    return Status::OK();
708
122k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
345
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
345
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
345
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
345
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
345
    }
706
345
    _closed = true;
707
345
    return Status::OK();
708
345
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
617k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
617k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
    }
706
617k
    _closed = true;
707
617k
    return Status::OK();
708
617k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
6.51k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
6.51k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
6.51k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
6.51k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
6.51k
    }
706
6.51k
    _closed = true;
707
6.51k
    return Status::OK();
708
6.51k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
330
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
330
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
330
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
330
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
330
    }
706
330
    _closed = true;
707
330
    return Status::OK();
708
330
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
2.37k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
2.37k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
2.37k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
2.37k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
2.37k
    }
706
2.37k
    _closed = true;
707
2.37k
    return Status::OK();
708
2.37k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
11.7k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
11.7k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
11.7k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
11.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
11.7k
    }
706
11.7k
    _closed = true;
707
11.7k
    return Status::OK();
708
11.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
312k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
312k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
312k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
312k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
312k
    }
706
312k
    _closed = true;
707
312k
    return Status::OK();
708
312k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
472k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
472k
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
472k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
472k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
472k
    }
706
472k
    _closed = true;
707
472k
    return Status::OK();
708
472k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
365
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
365
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
365
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
365
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
365
    }
706
365
    _closed = true;
707
365
    return Status::OK();
708
365
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
699
300
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
700
300
    if (_closed) {
701
0
        return Status::OK();
702
0
    }
703
300
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
704
300
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
705
300
    }
706
300
    _closed = true;
707
300
    return Status::OK();
708
300
}
709
710
template <typename LocalStateType>
711
6.81k
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
712
6.81k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
713
6.81k
    return pull(state, block, eos);
714
6.81k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
711
32
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
712
32
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
713
32
    return pull(state, block, eos);
714
32
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
711
6.78k
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
712
6.78k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
713
6.78k
    return pull(state, block, eos);
714
6.78k
}
715
716
template <typename LocalStateType>
717
871k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
718
871k
    auto& local_state = get_local_state(state);
719
871k
    if (need_more_input_data(state)) {
720
798k
        local_state._child_block->clear_column_data(
721
798k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
722
798k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
723
798k
                state, local_state._child_block.get(), &local_state._child_eos));
724
798k
        *eos = local_state._child_eos;
725
798k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
726
54.3k
            return Status::OK();
727
54.3k
        }
728
743k
        {
729
743k
            SCOPED_TIMER(local_state.exec_time_counter());
730
743k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
731
743k
        }
732
743k
    }
733
734
816k
    if (!need_more_input_data(state)) {
735
776k
        SCOPED_TIMER(local_state.exec_time_counter());
736
776k
        bool new_eos = false;
737
776k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
738
776k
        if (new_eos) {
739
703k
            *eos = true;
740
703k
        } else if (!need_more_input_data(state)) {
741
25.7k
            *eos = false;
742
25.7k
        }
743
776k
    }
744
816k
    return Status::OK();
745
816k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
717
185k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
718
185k
    auto& local_state = get_local_state(state);
719
185k
    if (need_more_input_data(state)) {
720
125k
        local_state._child_block->clear_column_data(
721
125k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
722
125k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
723
125k
                state, local_state._child_block.get(), &local_state._child_eos));
724
125k
        *eos = local_state._child_eos;
725
125k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
726
26.9k
            return Status::OK();
727
26.9k
        }
728
98.2k
        {
729
98.2k
            SCOPED_TIMER(local_state.exec_time_counter());
730
98.2k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
731
98.2k
        }
732
98.2k
    }
733
734
158k
    if (!need_more_input_data(state)) {
735
158k
        SCOPED_TIMER(local_state.exec_time_counter());
736
158k
        bool new_eos = false;
737
158k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
738
158k
        if (new_eos) {
739
108k
            *eos = true;
740
108k
        } else if (!need_more_input_data(state)) {
741
11.5k
            *eos = false;
742
11.5k
        }
743
158k
    }
744
158k
    return Status::OK();
745
158k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
717
3.09k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
718
3.09k
    auto& local_state = get_local_state(state);
719
3.09k
    if (need_more_input_data(state)) {
720
1.83k
        local_state._child_block->clear_column_data(
721
1.83k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
722
1.83k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
723
1.83k
                state, local_state._child_block.get(), &local_state._child_eos));
724
1.83k
        *eos = local_state._child_eos;
725
1.83k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
726
422
            return Status::OK();
727
422
        }
728
1.41k
        {
729
1.41k
            SCOPED_TIMER(local_state.exec_time_counter());
730
1.41k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
731
1.41k
        }
732
1.41k
    }
733
734
2.66k
    if (!need_more_input_data(state)) {
735
2.66k
        SCOPED_TIMER(local_state.exec_time_counter());
736
2.66k
        bool new_eos = false;
737
2.66k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
738
2.66k
        if (new_eos) {
739
1.02k
            *eos = true;
740
1.64k
        } else if (!need_more_input_data(state)) {
741
1.25k
            *eos = false;
742
1.25k
        }
743
2.66k
    }
744
2.66k
    return Status::OK();
745
2.66k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
717
1.57k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
718
1.57k
    auto& local_state = get_local_state(state);
719
1.57k
    if (need_more_input_data(state)) {
720
1.57k
        local_state._child_block->clear_column_data(
721
1.57k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
722
1.57k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
723
1.57k
                state, local_state._child_block.get(), &local_state._child_eos));
724
1.57k
        *eos = local_state._child_eos;
725
1.57k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
726
640
            return Status::OK();
727
640
        }
728
931
        {
729
931
            SCOPED_TIMER(local_state.exec_time_counter());
730
931
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
731
931
        }
732
931
    }
733
734
931
    if (!need_more_input_data(state)) {
735
931
        SCOPED_TIMER(local_state.exec_time_counter());
736
931
        bool new_eos = false;
737
931
        RETURN_IF_ERROR(pull(state, block, &new_eos));
738
931
        if (new_eos) {
739
663
            *eos = true;
740
663
        } else if (!need_more_input_data(state)) {
741
0
            *eos = false;
742
0
        }
743
931
    }
744
931
    return Status::OK();
745
931
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
717
19.4k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
718
19.4k
    auto& local_state = get_local_state(state);
719
19.4k
    if (need_more_input_data(state)) {
720
19.3k
        local_state._child_block->clear_column_data(
721
19.3k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
722
19.3k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
723
19.3k
                state, local_state._child_block.get(), &local_state._child_eos));
724
19.3k
        *eos = local_state._child_eos;
725
19.3k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
726
4.91k
            return Status::OK();
727
4.91k
        }
728
14.4k
        {
729
14.4k
            SCOPED_TIMER(local_state.exec_time_counter());
730
14.4k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
731
14.4k
        }
732
14.4k
    }
733
734
14.5k
    if (!need_more_input_data(state)) {
735
8.25k
        SCOPED_TIMER(local_state.exec_time_counter());
736
8.25k
        bool new_eos = false;
737
8.25k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
738
8.25k
        if (new_eos) {
739
8.07k
            *eos = true;
740
8.07k
        } else if (!need_more_input_data(state)) {
741
118
            *eos = false;
742
118
        }
743
8.25k
    }
744
14.5k
    return Status::OK();
745
14.5k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
717
629k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
718
629k
    auto& local_state = get_local_state(state);
719
630k
    if (need_more_input_data(state)) {
720
630k
        local_state._child_block->clear_column_data(
721
630k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
722
630k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
723
630k
                state, local_state._child_block.get(), &local_state._child_eos));
724
630k
        *eos = local_state._child_eos;
725
630k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
726
19.8k
            return Status::OK();
727
19.8k
        }
728
610k
        {
729
610k
            SCOPED_TIMER(local_state.exec_time_counter());
730
610k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
731
610k
        }
732
610k
    }
733
734
609k
    if (!need_more_input_data(state)) {
735
576k
        SCOPED_TIMER(local_state.exec_time_counter());
736
576k
        bool new_eos = false;
737
576k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
738
576k
        if (new_eos) {
739
574k
            *eos = true;
740
574k
        } else if (!need_more_input_data(state)) {
741
0
            *eos = false;
742
0
        }
743
576k
    }
744
609k
    return Status::OK();
745
609k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
717
25.9k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
718
25.9k
    auto& local_state = get_local_state(state);
719
25.9k
    if (need_more_input_data(state)) {
720
13.4k
        local_state._child_block->clear_column_data(
721
13.4k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
722
13.4k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
723
13.4k
                state, local_state._child_block.get(), &local_state._child_eos));
724
13.4k
        *eos = local_state._child_eos;
725
13.4k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
726
1.29k
            return Status::OK();
727
1.29k
        }
728
12.1k
        {
729
12.1k
            SCOPED_TIMER(local_state.exec_time_counter());
730
12.1k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
731
12.1k
        }
732
12.1k
    }
733
734
24.6k
    if (!need_more_input_data(state)) {
735
23.8k
        SCOPED_TIMER(local_state.exec_time_counter());
736
23.8k
        bool new_eos = false;
737
23.8k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
738
23.8k
        if (new_eos) {
739
5.55k
            *eos = true;
740
18.3k
        } else if (!need_more_input_data(state)) {
741
12.4k
            *eos = false;
742
12.4k
        }
743
23.8k
    }
744
24.6k
    return Status::OK();
745
24.6k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
717
7.00k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
718
7.00k
    auto& local_state = get_local_state(state);
719
7.00k
    if (need_more_input_data(state)) {
720
6.63k
        local_state._child_block->clear_column_data(
721
6.63k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
722
6.63k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
723
6.63k
                state, local_state._child_block.get(), &local_state._child_eos));
724
6.63k
        *eos = local_state._child_eos;
725
6.63k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
726
297
            return Status::OK();
727
297
        }
728
6.34k
        {
729
6.34k
            SCOPED_TIMER(local_state.exec_time_counter());
730
6.34k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
731
6.34k
        }
732
6.34k
    }
733
734
6.70k
    if (!need_more_input_data(state)) {
735
6.70k
        SCOPED_TIMER(local_state.exec_time_counter());
736
6.70k
        bool new_eos = false;
737
6.70k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
738
6.70k
        if (new_eos) {
739
4.82k
            *eos = true;
740
4.82k
        } else if (!need_more_input_data(state)) {
741
374
            *eos = false;
742
374
        }
743
6.70k
    }
744
6.70k
    return Status::OK();
745
6.70k
}
746
747
template <typename Writer, typename Parent>
748
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
749
65.7k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
750
65.7k
    RETURN_IF_ERROR(Base::init(state, info));
751
65.7k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
752
65.7k
                                                         "AsyncWriterDependency", true);
753
65.7k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
754
65.7k
                             _finish_dependency));
755
756
65.7k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
757
65.7k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
758
65.7k
    return Status::OK();
759
65.7k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
749
330
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
750
330
    RETURN_IF_ERROR(Base::init(state, info));
751
330
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
752
330
                                                         "AsyncWriterDependency", true);
753
330
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
754
330
                             _finish_dependency));
755
756
330
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
757
330
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
758
330
    return Status::OK();
759
330
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
749
65.3k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
750
65.3k
    RETURN_IF_ERROR(Base::init(state, info));
751
65.3k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
752
65.3k
                                                         "AsyncWriterDependency", true);
753
65.3k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
754
65.3k
                             _finish_dependency));
755
756
65.3k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
757
65.3k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
758
65.3k
    return Status::OK();
759
65.3k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
749
20
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
750
20
    RETURN_IF_ERROR(Base::init(state, info));
751
20
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
752
20
                                                         "AsyncWriterDependency", true);
753
20
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
754
20
                             _finish_dependency));
755
756
20
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
757
20
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
758
20
    return Status::OK();
759
20
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
760
761
template <typename Writer, typename Parent>
762
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
763
66.2k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
764
66.2k
    RETURN_IF_ERROR(Base::open(state));
765
66.2k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
766
461k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
767
395k
        RETURN_IF_ERROR(
768
395k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
769
395k
    }
770
66.2k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
771
66.2k
    return Status::OK();
772
66.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
763
331
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
764
331
    RETURN_IF_ERROR(Base::open(state));
765
331
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
766
1.75k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
767
1.42k
        RETURN_IF_ERROR(
768
1.42k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
769
1.42k
    }
770
331
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
771
331
    return Status::OK();
772
331
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
763
65.9k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
764
65.9k
    RETURN_IF_ERROR(Base::open(state));
765
65.9k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
766
459k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
767
393k
        RETURN_IF_ERROR(
768
393k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
769
393k
    }
770
65.9k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
771
65.9k
    return Status::OK();
772
65.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
763
20
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
764
20
    RETURN_IF_ERROR(Base::open(state));
765
20
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
766
360
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
767
340
        RETURN_IF_ERROR(
768
340
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
769
340
    }
770
20
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
771
20
    return Status::OK();
772
20
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
773
774
template <typename Writer, typename Parent>
775
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
776
78.8k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
777
78.8k
    return _writer->sink(block, eos);
778
78.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
776
1.26k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
777
1.26k
    return _writer->sink(block, eos);
778
1.26k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
776
77.5k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
777
77.5k
    return _writer->sink(block, eos);
778
77.5k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
776
20
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
777
20
    return _writer->sink(block, eos);
778
20
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
779
780
template <typename Writer, typename Parent>
781
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
782
66.3k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
783
66.3k
    if (_closed) {
784
0
        return Status::OK();
785
0
    }
786
66.3k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
787
66.3k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
788
    // if the init failed, the _writer may be nullptr. so here need check
789
66.3k
    if (_writer) {
790
66.3k
        Status st = _writer->get_writer_status();
791
66.3k
        if (exec_status.ok()) {
792
66.2k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
793
66.2k
                                                       : Status::Cancelled("force close"));
794
66.2k
        } else {
795
88
            _writer->force_close(exec_status);
796
88
        }
797
        // If there is an error in process_block thread, then we should get the writer
798
        // status before call force_close. For example, the thread may failed in commit
799
        // transaction.
800
66.3k
        RETURN_IF_ERROR(st);
801
66.3k
    }
802
66.2k
    return Base::close(state, exec_status);
803
66.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
782
319
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
783
319
    if (_closed) {
784
0
        return Status::OK();
785
0
    }
786
319
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
787
319
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
788
    // if the init failed, the _writer may be nullptr. so here need check
789
319
    if (_writer) {
790
319
        Status st = _writer->get_writer_status();
791
319
        if (exec_status.ok()) {
792
319
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
793
319
                                                       : Status::Cancelled("force close"));
794
319
        } else {
795
0
            _writer->force_close(exec_status);
796
0
        }
797
        // If there is an error in process_block thread, then we should get the writer
798
        // status before call force_close. For example, the thread may failed in commit
799
        // transaction.
800
319
        RETURN_IF_ERROR(st);
801
319
    }
802
319
    return Base::close(state, exec_status);
803
319
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
782
66.0k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
783
66.0k
    if (_closed) {
784
0
        return Status::OK();
785
0
    }
786
66.0k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
787
66.0k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
788
    // if the init failed, the _writer may be nullptr. so here need check
789
66.0k
    if (_writer) {
790
66.0k
        Status st = _writer->get_writer_status();
791
66.0k
        if (exec_status.ok()) {
792
65.9k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
793
65.9k
                                                       : Status::Cancelled("force close"));
794
65.9k
        } else {
795
88
            _writer->force_close(exec_status);
796
88
        }
797
        // If there is an error in process_block thread, then we should get the writer
798
        // status before call force_close. For example, the thread may failed in commit
799
        // transaction.
800
66.0k
        RETURN_IF_ERROR(st);
801
66.0k
    }
802
65.9k
    return Base::close(state, exec_status);
803
66.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
782
20
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
783
20
    if (_closed) {
784
0
        return Status::OK();
785
0
    }
786
20
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
787
20
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
788
    // if the init failed, the _writer may be nullptr. so here need check
789
20
    if (_writer) {
790
20
        Status st = _writer->get_writer_status();
791
20
        if (exec_status.ok()) {
792
20
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
793
20
                                                       : Status::Cancelled("force close"));
794
20
        } else {
795
0
            _writer->force_close(exec_status);
796
0
        }
797
        // If there is an error in process_block thread, then we should get the writer
798
        // status before call force_close. For example, the thread may failed in commit
799
        // transaction.
800
20
        RETURN_IF_ERROR(st);
801
20
    }
802
20
    return Base::close(state, exec_status);
803
20
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
804
805
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
806
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
807
DECLARE_OPERATOR(ResultSinkLocalState)
808
DECLARE_OPERATOR(JdbcTableSinkLocalState)
809
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
810
DECLARE_OPERATOR(ResultFileSinkLocalState)
811
DECLARE_OPERATOR(OlapTableSinkLocalState)
812
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
813
DECLARE_OPERATOR(HiveTableSinkLocalState)
814
DECLARE_OPERATOR(TVFTableSinkLocalState)
815
DECLARE_OPERATOR(IcebergTableSinkLocalState)
816
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
817
DECLARE_OPERATOR(MCTableSinkLocalState)
818
DECLARE_OPERATOR(AnalyticSinkLocalState)
819
DECLARE_OPERATOR(BlackholeSinkLocalState)
820
DECLARE_OPERATOR(SortSinkLocalState)
821
DECLARE_OPERATOR(SpillSortSinkLocalState)
822
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
823
DECLARE_OPERATOR(AggSinkLocalState)
824
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
825
DECLARE_OPERATOR(ExchangeSinkLocalState)
826
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
827
DECLARE_OPERATOR(UnionSinkLocalState)
828
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
829
DECLARE_OPERATOR(PartitionSortSinkLocalState)
830
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
831
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
832
DECLARE_OPERATOR(SetSinkLocalState<true>)
833
DECLARE_OPERATOR(SetSinkLocalState<false>)
834
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
835
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
836
DECLARE_OPERATOR(CacheSinkLocalState)
837
DECLARE_OPERATOR(DictSinkLocalState)
838
DECLARE_OPERATOR(RecCTESinkLocalState)
839
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
840
841
#undef DECLARE_OPERATOR
842
843
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
844
DECLARE_OPERATOR(HashJoinProbeLocalState)
845
DECLARE_OPERATOR(OlapScanLocalState)
846
DECLARE_OPERATOR(GroupCommitLocalState)
847
DECLARE_OPERATOR(JDBCScanLocalState)
848
DECLARE_OPERATOR(FileScanLocalState)
849
DECLARE_OPERATOR(EsScanLocalState)
850
DECLARE_OPERATOR(AnalyticLocalState)
851
DECLARE_OPERATOR(SortLocalState)
852
DECLARE_OPERATOR(SpillSortLocalState)
853
DECLARE_OPERATOR(LocalMergeSortLocalState)
854
DECLARE_OPERATOR(AggLocalState)
855
DECLARE_OPERATOR(PartitionedAggLocalState)
856
DECLARE_OPERATOR(TableFunctionLocalState)
857
DECLARE_OPERATOR(ExchangeLocalState)
858
DECLARE_OPERATOR(RepeatLocalState)
859
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
860
DECLARE_OPERATOR(AssertNumRowsLocalState)
861
DECLARE_OPERATOR(EmptySetLocalState)
862
DECLARE_OPERATOR(UnionSourceLocalState)
863
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
864
DECLARE_OPERATOR(PartitionSortSourceLocalState)
865
DECLARE_OPERATOR(SetSourceLocalState<true>)
866
DECLARE_OPERATOR(SetSourceLocalState<false>)
867
DECLARE_OPERATOR(DataGenLocalState)
868
DECLARE_OPERATOR(SchemaScanLocalState)
869
DECLARE_OPERATOR(MetaScanLocalState)
870
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
871
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
872
DECLARE_OPERATOR(CacheSourceLocalState)
873
DECLARE_OPERATOR(RecCTESourceLocalState)
874
DECLARE_OPERATOR(RecCTEScanLocalState)
875
876
#ifdef BE_TEST
877
DECLARE_OPERATOR(MockLocalState)
878
DECLARE_OPERATOR(MockScanLocalState)
879
#endif
880
#undef DECLARE_OPERATOR
881
882
template class StreamingOperatorX<AssertNumRowsLocalState>;
883
template class StreamingOperatorX<SelectLocalState>;
884
885
template class StatefulOperatorX<HashJoinProbeLocalState>;
886
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
887
template class StatefulOperatorX<RepeatLocalState>;
888
template class StatefulOperatorX<MaterializationLocalState>;
889
template class StatefulOperatorX<StreamingAggLocalState>;
890
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
891
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
892
template class StatefulOperatorX<TableFunctionLocalState>;
893
894
template class PipelineXSinkLocalState<HashJoinSharedState>;
895
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
896
template class PipelineXSinkLocalState<SortSharedState>;
897
template class PipelineXSinkLocalState<SpillSortSharedState>;
898
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
899
template class PipelineXSinkLocalState<AnalyticSharedState>;
900
template class PipelineXSinkLocalState<AggSharedState>;
901
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
902
template class PipelineXSinkLocalState<FakeSharedState>;
903
template class PipelineXSinkLocalState<UnionSharedState>;
904
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
905
template class PipelineXSinkLocalState<MultiCastSharedState>;
906
template class PipelineXSinkLocalState<SetSharedState>;
907
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
908
template class PipelineXSinkLocalState<BasicSharedState>;
909
template class PipelineXSinkLocalState<DataQueueSharedState>;
910
template class PipelineXSinkLocalState<RecCTESharedState>;
911
912
template class PipelineXLocalState<HashJoinSharedState>;
913
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
914
template class PipelineXLocalState<SortSharedState>;
915
template class PipelineXLocalState<SpillSortSharedState>;
916
template class PipelineXLocalState<NestedLoopJoinSharedState>;
917
template class PipelineXLocalState<AnalyticSharedState>;
918
template class PipelineXLocalState<AggSharedState>;
919
template class PipelineXLocalState<PartitionedAggSharedState>;
920
template class PipelineXLocalState<FakeSharedState>;
921
template class PipelineXLocalState<UnionSharedState>;
922
template class PipelineXLocalState<DataQueueSharedState>;
923
template class PipelineXLocalState<MultiCastSharedState>;
924
template class PipelineXLocalState<PartitionSortNodeSharedState>;
925
template class PipelineXLocalState<SetSharedState>;
926
template class PipelineXLocalState<LocalExchangeSharedState>;
927
template class PipelineXLocalState<BasicSharedState>;
928
template class PipelineXLocalState<RecCTESharedState>;
929
930
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
931
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
932
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
933
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
934
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
935
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
936
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
937
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
938
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
939
940
#ifdef BE_TEST
941
template class OperatorX<DummyOperatorLocalState>;
942
template class DataSinkOperatorX<DummySinkLocalState>;
943
#endif
944
945
#include "common/compile_check_end.h"
946
} // namespace doris