Coverage Report

Created: 2026-05-21 07:49

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