Coverage Report

Created: 2026-10-16 12:20

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