Coverage Report

Created: 2026-09-02 11:11

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