Coverage Report

Created: 2026-09-02 08:07

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