Coverage Report

Created: 2026-09-03 19:19

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.73M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.73M
    if (_parent->nereids_id() == -1) {
122
893k
        return fmt::format("(id={})", _parent->node_id());
123
893k
    } else {
124
837k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
837k
    }
126
1.73M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
64.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
64.1k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
64.1k
    } else {
124
64.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
64.1k
    }
126
64.1k
}
_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
37
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
37
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
37
    } else {
124
37
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
37
    }
126
37
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.61k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.61k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.61k
    } else {
124
5.61k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.61k
    }
126
5.61k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.32k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.32k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
8.31k
    } else {
124
8.31k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.31k
    }
126
8.32k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
79.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
79.6k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
79.6k
    } else {
124
79.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
79.6k
    }
126
79.6k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
75.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
75.1k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
75.1k
    } else {
124
75.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
75.1k
    }
126
75.1k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
54
    } else {
124
54
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54
    }
126
54
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
664k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
664k
    if (_parent->nereids_id() == -1) {
122
289k
        return fmt::format("(id={})", _parent->node_id());
123
374k
    } else {
124
374k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
374k
    }
126
664k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
50.5k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
50.5k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
50.5k
    } else {
124
50.5k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
50.5k
    }
126
50.5k
}
_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.94k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.94k
    if (_parent->nereids_id() == -1) {
122
4.93k
        return fmt::format("(id={})", _parent->node_id());
123
4.93k
    } else {
124
7
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
7
    }
126
4.94k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
422
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
422
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
320
    } else {
124
320
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
320
    }
126
422
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.12k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.12k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.11k
    } else {
124
5.11k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.11k
    }
126
5.12k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
598k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
598k
    if (_parent->nereids_id() == -1) {
122
598k
        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
598k
}
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
666k
        return fmt::format("(id={})", _parent->node_id());
132
666k
    } else {
133
462k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
462k
    }
135
1.12M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
113k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
113k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
113k
    } else {
133
113k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
113k
    }
135
113k
}
_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
44
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
44
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
44
    } else {
133
44
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
44
    }
135
44
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.70k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.70k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
5.70k
    } else {
133
5.70k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.70k
    }
135
5.70k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.44k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.44k
    if (_parent->nereids_id() == -1) {
131
12
        return fmt::format("(id={})", _parent->node_id());
132
8.42k
    } else {
133
8.42k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.42k
    }
135
8.44k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
80.1k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
80.1k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
80.1k
    } else {
133
80.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
80.1k
    }
135
80.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
75.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
75.0k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
75.0k
    } else {
133
75.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
75.0k
    }
135
75.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
64
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
64
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
64
    } else {
133
64
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
64
    }
135
64
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
6
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
6
    if (_parent->nereids_id() == -1) {
131
6
        return fmt::format("(id={})", _parent->node_id());
132
6
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
6
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
4.55k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
4.55k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
4.55k
    } else {
133
4.55k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
4.55k
    }
135
4.55k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
424
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
424
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
322
    } else {
133
322
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
322
    }
135
424
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.4k
    if (_parent->nereids_id() == -1) {
131
12.4k
        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
220k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
221k
    if (_parent->nereids_id() == -1) {
131
221k
        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
220k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
432k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
432k
    if (_parent->nereids_id() == -1) {
131
432k
        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
432k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
24
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
25
    if (_parent->nereids_id() == -1) {
131
25
        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
24
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
328
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
328
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
328
    } else {
133
328
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
328
    }
135
328
}
136
137
template <typename SharedStateArg>
138
29.2k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
29.2k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
29.2k
    _terminated = true;
143
29.2k
    return Status::OK();
144
29.2k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.97k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.97k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.97k
    _terminated = true;
143
1.97k
    return Status::OK();
144
1.97k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
4
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
4
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
4
    _terminated = true;
143
4
    return Status::OK();
144
4
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.65k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.65k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.65k
    _terminated = true;
143
1.65k
    return Status::OK();
144
1.65k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
536
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
536
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
536
    _terminated = true;
143
536
    return Status::OK();
144
536
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
589
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
589
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
589
    _terminated = true;
143
589
    return Status::OK();
144
589
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
36
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
36
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
36
    _terminated = true;
143
36
    return Status::OK();
144
36
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_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
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
172
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
172
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
172
    _terminated = true;
143
172
    return Status::OK();
144
172
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
17
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
17
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
17
    _terminated = true;
143
17
    return Status::OK();
144
17
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
133
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
133
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
133
    _terminated = true;
143
133
    return Status::OK();
144
133
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
136
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
136
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
136
    _terminated = true;
143
136
    return Status::OK();
144
136
}
145
146
286k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
286k
    return _child && _child->is_serial_operator() && !is_source()
148
286k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
286k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
286k
}
151
152
23.8k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
23.8k
    if (!_child) {
154
22.8k
        return false;
155
22.8k
    }
156
1.02k
    if (_child->is_serial_operator()) {
157
128
        return true;
158
128
    }
159
896
    const auto child_distribution = _child->required_data_distribution(state);
160
896
    return child_distribution.need_local_exchange() &&
161
896
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.02k
}
163
164
template <typename SharedStateArg>
165
18.3k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
18.3k
    fmt::memory_buffer debug_string_buffer;
167
18.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
18.3k
    return fmt::to_string(debug_string_buffer);
169
18.3k
}
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
18.3k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
18.3k
    fmt::memory_buffer debug_string_buffer;
167
18.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
18.3k
    return fmt::to_string(debug_string_buffer);
169
18.3k
}
_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
18.3k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
18.3k
    fmt::memory_buffer debug_string_buffer;
174
18.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
18.3k
    return fmt::to_string(debug_string_buffer);
176
18.3k
}
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
18.3k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
18.3k
    fmt::memory_buffer debug_string_buffer;
174
18.3k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
18.3k
    return fmt::to_string(debug_string_buffer);
176
18.3k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
18.4k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
18.4k
    fmt::memory_buffer debug_string_buffer;
180
18.4k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
18.4k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
18.4k
                   _is_serial_operator);
183
18.4k
    return fmt::to_string(debug_string_buffer);
184
18.4k
}
185
186
18.3k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
18.3k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
18.3k
}
189
190
609k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
609k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
609k
    _nereids_id = tnode.nereids_id;
193
609k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.20k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.20k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.20k
            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.20k
    }
206
609k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
609k
    _op_name = substr + "_OPERATOR";
208
209
609k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
609k
    } else if (tnode.__isset.conjuncts) {
212
251k
        for (const auto& conjunct : tnode.conjuncts) {
213
251k
            VExprContextSPtr context;
214
251k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
251k
            _conjuncts.emplace_back(context);
216
251k
        }
217
85.9k
    }
218
219
    // create the projections expr
220
609k
    if (tnode.__isset.projections) {
221
234k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
234k
    }
223
609k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.20k
        DCHECK(has_projection()) << "no final projections";
225
3.20k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
4.26k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
4.26k
            VExprContextSPtrs projections;
228
4.26k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
4.26k
            _projection->intermediate_projections.push_back(projections);
230
4.26k
        }
231
3.20k
    }
232
609k
    return Status::OK();
233
609k
}
234
235
635k
Status OperatorXBase::prepare(RuntimeState* state) {
236
635k
    for (auto& conjunct : _conjuncts) {
237
251k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
251k
    }
239
635k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
585k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
324k
            return a->execute_cost() < b->execute_cost();
242
324k
        });
243
585k
    };
244
245
635k
    if (has_projection()) {
246
233k
        auto& projection = *_projection;
247
238k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
4.26k
            const auto& input_row_desc =
249
4.26k
                    i == 0 ? operator_row_desc_before_projection()
250
4.26k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
4.26k
            RETURN_IF_ERROR(
252
4.26k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
4.26k
        }
254
233k
        const auto& final_projection_input_row_desc =
255
233k
                projection.intermediate_output_row_descriptors.empty()
256
233k
                        ? operator_row_desc_before_projection()
257
233k
                        : projection.intermediate_output_row_descriptors.back();
258
233k
        RETURN_IF_ERROR(
259
233k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
233k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
233k
                                                      projection.output_row_descriptor));
262
233k
    }
263
264
635k
    for (auto& conjunct : _conjuncts) {
265
251k
        RETURN_IF_ERROR(conjunct->open(state));
266
251k
    }
267
635k
    if (has_projection()) {
268
233k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
233k
        for (auto& projections : _projection->intermediate_projections) {
270
4.26k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
4.26k
        }
272
233k
    }
273
635k
    if (_child && !is_source()) {
274
99.6k
        RETURN_IF_ERROR(_child->prepare(state));
275
99.6k
    }
276
277
635k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
635k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
635k
    return Status::OK();
283
635k
}
284
285
5.87k
Status OperatorXBase::terminate(RuntimeState* state) {
286
5.87k
    if (_child && !is_source()) {
287
585
        RETURN_IF_ERROR(_child->terminate(state));
288
585
    }
289
5.87k
    auto result = state->get_local_state_result(operator_id());
290
5.87k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
5.87k
    return result.value()->terminate(state);
294
5.87k
}
295
296
4.79M
Status OperatorXBase::close(RuntimeState* state) {
297
4.79M
    if (_child && !is_source()) {
298
883k
        RETURN_IF_ERROR(_child->close(state));
299
883k
    }
300
4.79M
    auto result = state->get_local_state_result(operator_id());
301
4.79M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.79M
    return result.value()->close(state);
305
4.79M
}
306
307
261k
void PipelineXLocalStateBase::clear_origin_block() {
308
261k
    _origin_block.clear_column_data(
309
261k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
261k
}
311
312
789k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
789k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
789k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
789k
    return Status::OK();
317
789k
}
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
261k
                                     Block* output_block) const {
326
261k
    auto* local_state = state->get_local_state(operator_id());
327
261k
    SCOPED_TIMER(local_state->exec_time_counter());
328
261k
    SCOPED_TIMER(local_state->_projection_timer);
329
261k
    const size_t rows = origin_block->rows();
330
261k
    if (rows == 0) {
331
136k
        return Status::OK();
332
136k
    }
333
124k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
124k
    {
336
124k
        Block input_block = *origin_block;
337
338
124k
        ColumnsWithTypeAndName new_columns;
339
124k
        for (const auto& projections : local_state->_intermediate_projections) {
340
1.33k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
1.33k
            new_columns.resize(projections.size());
345
8.72k
            for (int i = 0; i < projections.size(); i++) {
346
7.38k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
7.38k
                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
7.38k
            }
355
1.33k
            Block tmp_block {new_columns};
356
1.33k
            input_block.swap(tmp_block);
357
1.33k
        }
358
359
124k
        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
124k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
124k
                output_block, _projection->output_row_descriptor);
368
124k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
124k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
124k
        Columns shared_columns(mutable_columns.size());
371
372
683k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
558k
            ColumnPtr column_ptr;
374
558k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
558k
            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
558k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
558k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
558k
            if (column_ptr->is_exclusive()) {
386
198k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
360k
            } else {
388
360k
                shared_columns[i] = std::move(column_ptr);
389
360k
            }
390
558k
        }
391
392
124k
        scoped_mutable_block.restore();
393
683k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
558k
            if (shared_columns[i]) {
395
360k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
360k
            }
397
558k
        }
398
124k
    }
399
400
0
    origin_block->clear_column_data(
401
124k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
124k
    DCHECK_EQ(output_block->rows(), rows);
403
404
124k
    return Status::OK();
405
124k
}
406
407
4.36M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.36M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.36M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.36M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.36M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.36M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.36M
            if (_debug_point_count++ % 2 == 0) {
414
4.36M
                return Status::OK();
415
4.36M
            }
416
4.36M
        }
417
4.36M
    });
418
419
4.36M
    Status status;
420
4.36M
    auto* local_state = state->get_local_state(operator_id());
421
4.36M
    Defer defer([&]() {
422
4.36M
        if (status.ok()) {
423
4.36M
            local_state->update_output_block_counters(*block);
424
4.36M
        }
425
4.36M
    });
426
4.36M
    if (has_projection()) {
427
261k
        local_state->clear_origin_block();
428
261k
        status = get_block(state, &local_state->_origin_block, eos);
429
261k
        if (UNLIKELY(!status.ok())) {
430
23
            return status;
431
23
        }
432
261k
        status = do_projections(state, &local_state->_origin_block, block);
433
261k
        return status;
434
261k
    }
435
4.09M
    status = get_block(state, block, eos);
436
4.09M
    RETURN_IF_ERROR(block->check_type_and_column());
437
4.09M
    return status;
438
4.09M
}
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.40k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
3.40k
        *eos = true;
444
3.40k
    }
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
703k
        _num_rows_returned += rows;
458
703k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
703k
    }
460
2.59M
}
461
462
29.2k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
29.2k
    auto result = state->get_sink_local_state_result();
464
29.2k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
29.2k
    return result.value()->terminate(state);
468
29.2k
}
469
470
18.3k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
18.3k
    fmt::memory_buffer debug_string_buffer;
472
473
18.3k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
18.3k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
18.3k
    return fmt::to_string(debug_string_buffer);
476
18.3k
}
477
478
18.3k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
18.3k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
18.3k
}
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
268k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
268k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
268k
    _nereids_id = tnode.nereids_id;
496
268k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
268k
    _name = substr + "_SINK_OPERATOR";
498
268k
    return Status::OK();
499
268k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.60M
                                                            LocalSinkStateInfo& info) {
504
1.60M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.60M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.60M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.60M
    return Status::OK();
508
1.60M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
113k
                                                            LocalSinkStateInfo& info) {
504
113k
    auto local_state = LocalStateType::create_unique(this, state);
505
113k
    RETURN_IF_ERROR(local_state->init(state, info));
506
113k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
113k
    return Status::OK();
508
113k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
389k
                                                            LocalSinkStateInfo& info) {
504
389k
    auto local_state = LocalStateType::create_unique(this, state);
505
389k
    RETURN_IF_ERROR(local_state->init(state, info));
506
389k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
389k
    return Status::OK();
508
389k
}
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
355
                                                            LocalSinkStateInfo& info) {
504
355
    auto local_state = LocalStateType::create_unique(this, state);
505
355
    RETURN_IF_ERROR(local_state->init(state, info));
506
355
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
355
    return Status::OK();
508
355
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
42.5k
                                                            LocalSinkStateInfo& info) {
504
42.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
42.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
42.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
42.5k
    return Status::OK();
508
42.5k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8
                                                            LocalSinkStateInfo& info) {
504
8
    auto local_state = LocalStateType::create_unique(this, state);
505
8
    RETURN_IF_ERROR(local_state->init(state, info));
506
8
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8
    return Status::OK();
508
8
}
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
8.45k
                                                            LocalSinkStateInfo& info) {
504
8.45k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.45k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.45k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.45k
    return Status::OK();
508
8.45k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_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_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
44
                                                            LocalSinkStateInfo& info) {
504
44
    auto local_state = LocalStateType::create_unique(this, state);
505
44
    RETURN_IF_ERROR(local_state->init(state, info));
506
44
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
44
    return Status::OK();
508
44
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
220k
                                                            LocalSinkStateInfo& info) {
504
220k
    auto local_state = LocalStateType::create_unique(this, state);
505
220k
    RETURN_IF_ERROR(local_state->init(state, info));
506
220k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
220k
    return Status::OK();
508
220k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
80.2k
                                                            LocalSinkStateInfo& info) {
504
80.2k
    auto local_state = LocalStateType::create_unique(this, state);
505
80.2k
    RETURN_IF_ERROR(local_state->init(state, info));
506
80.2k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
80.2k
    return Status::OK();
508
80.2k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
75.0k
                                                            LocalSinkStateInfo& info) {
504
75.0k
    auto local_state = LocalStateType::create_unique(this, state);
505
75.0k
    RETURN_IF_ERROR(local_state->init(state, info));
506
75.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
75.0k
    return Status::OK();
508
75.0k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
64
                                                            LocalSinkStateInfo& info) {
504
64
    auto local_state = LocalStateType::create_unique(this, state);
505
64
    RETURN_IF_ERROR(local_state->init(state, info));
506
64
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
64
    return Status::OK();
508
64
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
471k
                                                            LocalSinkStateInfo& info) {
504
471k
    auto local_state = LocalStateType::create_unique(this, state);
505
471k
    RETURN_IF_ERROR(local_state->init(state, info));
506
471k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
471k
    return Status::OK();
508
471k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
5.73k
                                                            LocalSinkStateInfo& info) {
504
5.73k
    auto local_state = LocalStateType::create_unique(this, state);
505
5.73k
    RETURN_IF_ERROR(local_state->init(state, info));
506
5.73k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
5.73k
    return Status::OK();
508
5.73k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.55k
                                                            LocalSinkStateInfo& info) {
504
4.55k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.55k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.55k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.55k
    return Status::OK();
508
4.55k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1.88k
                                                            LocalSinkStateInfo& info) {
504
1.88k
    auto local_state = LocalStateType::create_unique(this, state);
505
1.88k
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.88k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.88k
    return Status::OK();
508
1.88k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
322
                                                            LocalSinkStateInfo& info) {
504
322
    auto local_state = LocalStateType::create_unique(this, state);
505
322
    RETURN_IF_ERROR(local_state->init(state, info));
506
322
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
322
    return Status::OK();
508
322
}
_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.52k
                                                            LocalSinkStateInfo& info) {
504
2.52k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.52k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.52k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.52k
    return Status::OK();
508
2.52k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.59k
                                                            LocalSinkStateInfo& info) {
504
2.59k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.59k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.59k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.59k
    return Status::OK();
508
2.59k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.47k
                                                            LocalSinkStateInfo& info) {
504
2.47k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.47k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.47k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.47k
    return Status::OK();
508
2.47k
}
_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
564
                                                            LocalSinkStateInfo& info) {
504
564
    auto local_state = LocalStateType::create_unique(this, state);
505
564
    RETURN_IF_ERROR(local_state->init(state, info));
506
564
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
564
    return Status::OK();
508
564
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
13
                                                            LocalSinkStateInfo& info) {
504
13
    auto local_state = LocalStateType::create_unique(this, state);
505
13
    RETURN_IF_ERROR(local_state->init(state, info));
506
13
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
13
    return Status::OK();
508
13
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
102
                                                            LocalSinkStateInfo& info) {
504
102
    auto local_state = LocalStateType::create_unique(this, state);
505
102
    RETURN_IF_ERROR(local_state->init(state, info));
506
102
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
102
    return Status::OK();
508
102
}
_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.28M
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.28M
    } else {
519
1.28M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.28M
        ss->id = operator_id();
521
1.28M
        for (auto& dest : dests_id()) {
522
1.27M
            ss->related_op_ids.insert(dest);
523
1.27M
        }
524
1.28M
        return ss;
525
1.28M
    }
526
1.28M
}
_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
389k
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
389k
    } else {
519
389k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
389k
        ss->id = operator_id();
521
389k
        for (auto& dest : dests_id()) {
522
389k
            ss->related_op_ids.insert(dest);
523
389k
        }
524
389k
        return ss;
525
389k
    }
526
389k
}
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
358
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
358
    } else {
519
358
        auto ss = LocalStateType::SharedStateType::create_shared();
520
358
        ss->id = operator_id();
521
358
        for (auto& dest : dests_id()) {
522
358
            ss->related_op_ids.insert(dest);
523
358
        }
524
358
        return ss;
525
358
    }
526
358
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
42.6k
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.6k
    } else {
519
42.6k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
42.6k
        ss->id = operator_id();
521
42.6k
        for (auto& dest : dests_id()) {
522
42.3k
            ss->related_op_ids.insert(dest);
523
42.3k
        }
524
42.6k
        return ss;
525
42.6k
    }
526
42.6k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
8
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
8
    } else {
519
8
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8
        ss->id = operator_id();
521
8
        for (auto& dest : dests_id()) {
522
8
            ss->related_op_ids.insert(dest);
523
8
        }
524
8
        return ss;
525
8
    }
526
8
}
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
8.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
8.47k
    } else {
519
8.47k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.47k
        ss->id = operator_id();
521
8.47k
        for (auto& dest : dests_id()) {
522
8.47k
            ss->related_op_ids.insert(dest);
523
8.47k
        }
524
8.47k
        return ss;
525
8.47k
    }
526
8.47k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_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_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
176k
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
176k
    } else {
519
176k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
176k
        ss->id = operator_id();
521
176k
        for (auto& dest : dests_id()) {
522
176k
            ss->related_op_ids.insert(dest);
523
176k
        }
524
176k
        return ss;
525
176k
    }
526
176k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
46
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
46
    } else {
519
46
        auto ss = LocalStateType::SharedStateType::create_shared();
520
46
        ss->id = operator_id();
521
46
        for (auto& dest : dests_id()) {
522
46
            ss->related_op_ids.insert(dest);
523
46
        }
524
46
        return ss;
525
46
    }
526
46
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
80.4k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
80.4k
    } else {
519
80.4k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
80.4k
        ss->id = operator_id();
521
80.4k
        for (auto& dest : dests_id()) {
522
80.4k
            ss->related_op_ids.insert(dest);
523
80.4k
        }
524
80.4k
        return ss;
525
80.4k
    }
526
80.4k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
63
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
63
    } else {
519
63
        auto ss = LocalStateType::SharedStateType::create_shared();
520
63
        ss->id = operator_id();
521
63
        for (auto& dest : dests_id()) {
522
62
            ss->related_op_ids.insert(dest);
523
62
        }
524
63
        return ss;
525
63
    }
526
63
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
473k
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
473k
    } else {
519
473k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
473k
        ss->id = operator_id();
521
473k
        for (auto& dest : dests_id()) {
522
468k
            ss->related_op_ids.insert(dest);
523
468k
        }
524
473k
        return ss;
525
473k
    }
526
473k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
5.75k
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.75k
    } else {
519
5.75k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
5.75k
        ss->id = operator_id();
521
5.75k
        for (auto& dest : dests_id()) {
522
5.72k
            ss->related_op_ids.insert(dest);
523
5.72k
        }
524
5.75k
        return ss;
525
5.75k
    }
526
5.75k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
423
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
423
    } else {
519
423
        auto ss = LocalStateType::SharedStateType::create_shared();
520
423
        ss->id = operator_id();
521
423
        for (auto& dest : dests_id()) {
522
422
            ss->related_op_ids.insert(dest);
523
422
        }
524
423
        return ss;
525
423
    }
526
423
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.59k
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.59k
    } else {
519
2.59k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.59k
        ss->id = operator_id();
521
2.59k
        for (auto& dest : dests_id()) {
522
2.59k
            ss->related_op_ids.insert(dest);
523
2.59k
        }
524
2.59k
        return ss;
525
2.59k
    }
526
2.59k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.48k
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.48k
    } else {
519
2.48k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.48k
        ss->id = operator_id();
521
2.48k
        for (auto& dest : dests_id()) {
522
2.48k
            ss->related_op_ids.insert(dest);
523
2.48k
        }
524
2.48k
        return ss;
525
2.48k
    }
526
2.48k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
568
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
568
    } else {
519
568
        auto ss = LocalStateType::SharedStateType::create_shared();
520
568
        ss->id = operator_id();
521
568
        for (auto& dest : dests_id()) {
522
563
            ss->related_op_ids.insert(dest);
523
563
        }
524
568
        return ss;
525
568
    }
526
568
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
102
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
102
    } else {
519
102
        auto ss = LocalStateType::SharedStateType::create_shared();
520
102
        ss->id = operator_id();
521
102
        for (auto& dest : dests_id()) {
522
102
            ss->related_op_ids.insert(dest);
523
102
        }
524
102
        return ss;
525
102
    }
526
102
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.97M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.97M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.97M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.97M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.97M
    return Status::OK();
534
1.97M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
64.9k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
64.9k
    auto local_state = LocalStateType::create_unique(state, this);
531
64.9k
    RETURN_IF_ERROR(local_state->init(state, info));
532
64.9k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
64.9k
    return Status::OK();
534
64.9k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
227k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
227k
    auto local_state = LocalStateType::create_unique(state, this);
531
227k
    RETURN_IF_ERROR(local_state->init(state, info));
532
227k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
227k
    return Status::OK();
534
227k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
120
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
120
    auto local_state = LocalStateType::create_unique(state, this);
531
120
    RETURN_IF_ERROR(local_state->init(state, info));
532
120
    state->emplace_local_state(operator_id(), std::move(local_state));
533
120
    return Status::OK();
534
120
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.06k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.06k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.06k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.06k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.06k
    return Status::OK();
534
3.06k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.39k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.39k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.39k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.39k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.39k
    return Status::OK();
534
8.39k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.35k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.35k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.35k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.35k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.35k
    return Status::OK();
534
8.35k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
37
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
37
    auto local_state = LocalStateType::create_unique(state, this);
531
37
    RETURN_IF_ERROR(local_state->init(state, info));
532
37
    state->emplace_local_state(operator_id(), std::move(local_state));
533
37
    return Status::OK();
534
37
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
167k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
167k
    auto local_state = LocalStateType::create_unique(state, this);
531
167k
    RETURN_IF_ERROR(local_state->init(state, info));
532
167k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
167k
    return Status::OK();
534
167k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
80.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
80.1k
    auto local_state = LocalStateType::create_unique(state, this);
531
80.1k
    RETURN_IF_ERROR(local_state->init(state, info));
532
80.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
80.1k
    return Status::OK();
534
80.1k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
75.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
75.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
75.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
75.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
75.3k
    return Status::OK();
534
75.3k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
54
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54
    auto local_state = LocalStateType::create_unique(state, this);
531
54
    RETURN_IF_ERROR(local_state->init(state, info));
532
54
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54
    return Status::OK();
534
54
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.08k
    return Status::OK();
534
5.08k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
290k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
290k
    auto local_state = LocalStateType::create_unique(state, this);
531
290k
    RETURN_IF_ERROR(local_state->init(state, info));
532
290k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
290k
    return Status::OK();
534
290k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.14k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.14k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.14k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.14k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.14k
    return Status::OK();
534
1.14k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.65k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.65k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.65k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.65k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.65k
    return Status::OK();
534
5.65k
}
_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.50k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.50k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.50k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.50k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.50k
    return Status::OK();
534
1.50k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
50.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
50.6k
    auto local_state = LocalStateType::create_unique(state, this);
531
50.6k
    RETURN_IF_ERROR(local_state->init(state, info));
532
50.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
50.6k
    return Status::OK();
534
50.6k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.95k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.95k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.95k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.95k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.95k
    return Status::OK();
534
4.95k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
322
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
322
    auto local_state = LocalStateType::create_unique(state, this);
531
322
    RETURN_IF_ERROR(local_state->init(state, info));
532
322
    state->emplace_local_state(operator_id(), std::move(local_state));
533
322
    return Status::OK();
534
322
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.61k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.61k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.61k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.61k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.61k
    return Status::OK();
534
2.61k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.49k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.49k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.49k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.49k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.49k
    return Status::OK();
534
2.49k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
291
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
291
    auto local_state = LocalStateType::create_unique(state, this);
531
291
    RETURN_IF_ERROR(local_state->init(state, info));
532
291
    state->emplace_local_state(operator_id(), std::move(local_state));
533
291
    return Status::OK();
534
291
}
_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.22k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.22k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.22k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.22k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.22k
    return Status::OK();
534
4.22k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
603k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
603k
    auto local_state = LocalStateType::create_unique(state, this);
531
603k
    RETURN_IF_ERROR(local_state->init(state, info));
532
603k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
603k
    return Status::OK();
534
603k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
13
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
13
    auto local_state = LocalStateType::create_unique(state, this);
531
13
    RETURN_IF_ERROR(local_state->init(state, info));
532
13
    state->emplace_local_state(operator_id(), std::move(local_state));
533
13
    return Status::OK();
534
13
}
_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
776
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
776
    auto local_state = LocalStateType::create_unique(state, this);
531
776
    RETURN_IF_ERROR(local_state->init(state, info));
532
776
    state->emplace_local_state(operator_id(), std::move(local_state));
533
776
    return Status::OK();
534
776
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
834
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
834
    auto local_state = LocalStateType::create_unique(state, this);
531
834
    RETURN_IF_ERROR(local_state->init(state, info));
532
834
    state->emplace_local_state(operator_id(), std::move(local_state));
533
834
    return Status::OK();
534
834
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.92k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.92k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.92k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.92k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.92k
    return Status::OK();
534
5.92k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
353k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
353k
    auto local_state = LocalStateType::create_unique(state, this);
531
353k
    RETURN_IF_ERROR(local_state->init(state, info));
532
353k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
353k
    return Status::OK();
534
353k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.60M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.96M
        : _num_rows_returned(0),
542
1.96M
          _rows_returned_counter(nullptr),
543
1.96M
          _parent(parent),
544
1.96M
          _state(state),
545
1.96M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.97M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.97M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.97M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.97M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.97M
    _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.97M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.97M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.97M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.97M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.97M
    if constexpr (!is_fake_shared) {
560
1.07M
        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
59.6k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
4.71k
                DCHECK(false);
582
4.71k
            }
583
59.6k
        }
584
1.07M
    }
585
586
1.97M
    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.97M
    _rows_returned_counter =
591
1.97M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.97M
    _blocks_returned_counter =
593
1.97M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.97M
    _output_block_bytes_counter =
595
1.97M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.97M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.97M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.97M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.97M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.97M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.97M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.97M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.97M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.97M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.97M
    _memory_used_counter =
606
1.97M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.97M
    _common_profile->add_info_string("IsColocate",
608
1.97M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.97M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.97M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.97M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.97M
    return Status::OK();
613
1.97M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
64.6k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
64.6k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
64.6k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
64.6k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
64.6k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
64.6k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
64.6k
    _operator_profile->add_child(_common_profile.get(), true);
557
64.6k
    _operator_profile->add_child(_custom_profile.get(), true);
558
64.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
64.6k
    if constexpr (!is_fake_shared) {
560
64.6k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
12.7k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
12.7k
                                    .first.get()
563
12.7k
                                    ->template cast<SharedStateArg>();
564
565
12.7k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
12.7k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
12.7k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
51.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
51.0k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
51.0k
            _dependency = _shared_state->create_source_dependency(
576
51.0k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
51.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
51.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
51.0k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
835
        }
584
64.6k
    }
585
586
64.6k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
64.6k
    _rows_returned_counter =
591
64.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
64.6k
    _blocks_returned_counter =
593
64.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
64.6k
    _output_block_bytes_counter =
595
64.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
64.6k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
64.6k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
64.6k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
64.6k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
64.6k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
64.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
64.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
64.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
64.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
64.6k
    _memory_used_counter =
606
64.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
64.6k
    _common_profile->add_info_string("IsColocate",
608
64.6k
                                     std::to_string(_parent->is_colocated_operator()));
609
64.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
64.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
64.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
64.6k
    return Status::OK();
613
64.6k
}
_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
175k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
175k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
175k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
175k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
175k
    _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
175k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
175k
    _operator_profile->add_child(_common_profile.get(), true);
557
175k
    _operator_profile->add_child(_custom_profile.get(), true);
558
175k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
175k
    if constexpr (!is_fake_shared) {
560
175k
        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
175k
        } 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
172k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
172k
            _dependency = _shared_state->create_source_dependency(
576
172k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
172k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
172k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
172k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
3.84k
        }
584
175k
    }
585
586
175k
    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
175k
    _rows_returned_counter =
591
175k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
175k
    _blocks_returned_counter =
593
175k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
175k
    _output_block_bytes_counter =
595
175k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
175k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
175k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
175k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
175k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
175k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
175k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
175k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
175k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
175k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
175k
    _memory_used_counter =
606
175k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
175k
    _common_profile->add_info_string("IsColocate",
608
175k
                                     std::to_string(_parent->is_colocated_operator()));
609
175k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
175k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
175k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
175k
    return Status::OK();
613
175k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
37
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
37
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
37
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
37
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
37
    _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
37
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
37
    _operator_profile->add_child(_common_profile.get(), true);
557
37
    _operator_profile->add_child(_custom_profile.get(), true);
558
37
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
37
    if constexpr (!is_fake_shared) {
560
37
        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
37
        } 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
37
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
37
            _dependency = _shared_state->create_source_dependency(
576
37
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
37
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
37
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
37
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
37
    }
585
586
37
    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
37
    _rows_returned_counter =
591
37
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
37
    _blocks_returned_counter =
593
37
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
37
    _output_block_bytes_counter =
595
37
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
37
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
37
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
37
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
37
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
37
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
37
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
37
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
37
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
37
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
37
    _memory_used_counter =
606
37
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
37
    _common_profile->add_info_string("IsColocate",
608
37
                                     std::to_string(_parent->is_colocated_operator()));
609
37
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
37
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
37
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
37
    return Status::OK();
613
37
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.69k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.69k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.69k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.69k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.69k
    _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.69k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.69k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.69k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.69k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.69k
    if constexpr (!is_fake_shared) {
560
5.69k
        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.69k
        } 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.49k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.49k
            _dependency = _shared_state->create_source_dependency(
576
5.49k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.49k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.49k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.49k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
203
        }
584
5.69k
    }
585
586
5.69k
    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.69k
    _rows_returned_counter =
591
5.69k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.69k
    _blocks_returned_counter =
593
5.69k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.69k
    _output_block_bytes_counter =
595
5.69k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.69k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.69k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.69k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.69k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.69k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.69k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.69k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.69k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.69k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.69k
    _memory_used_counter =
606
5.69k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.69k
    _common_profile->add_info_string("IsColocate",
608
5.69k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.69k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.69k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.69k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.69k
    return Status::OK();
613
5.69k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.41k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.41k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.41k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.41k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.41k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
8.41k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.41k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.41k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.41k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.41k
    if constexpr (!is_fake_shared) {
560
8.41k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
8.41k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
8.31k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.31k
            _dependency = _shared_state->create_source_dependency(
576
8.31k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.31k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.31k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.31k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
108
        }
584
8.41k
    }
585
586
8.41k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
8.41k
    _rows_returned_counter =
591
8.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.41k
    _blocks_returned_counter =
593
8.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.41k
    _output_block_bytes_counter =
595
8.41k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.41k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.41k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.41k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.41k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.41k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.41k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.41k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.41k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.41k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.41k
    _memory_used_counter =
606
8.41k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.41k
    _common_profile->add_info_string("IsColocate",
608
8.41k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.41k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.41k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.41k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.41k
    return Status::OK();
613
8.41k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
80.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
80.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
80.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
80.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
80.4k
    _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
80.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
80.4k
    _operator_profile->add_child(_common_profile.get(), true);
557
80.4k
    _operator_profile->add_child(_custom_profile.get(), true);
558
80.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
80.4k
    if constexpr (!is_fake_shared) {
560
80.4k
        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
80.4k
        } 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
79.0k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
79.0k
            _dependency = _shared_state->create_source_dependency(
576
79.0k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
79.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
79.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
79.0k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.39k
        }
584
80.4k
    }
585
586
80.4k
    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
80.4k
    _rows_returned_counter =
591
80.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
80.4k
    _blocks_returned_counter =
593
80.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
80.4k
    _output_block_bytes_counter =
595
80.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
80.4k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
80.4k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
80.4k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
80.4k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
80.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
80.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
80.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
80.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
80.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
80.4k
    _memory_used_counter =
606
80.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
80.4k
    _common_profile->add_info_string("IsColocate",
608
80.4k
                                     std::to_string(_parent->is_colocated_operator()));
609
80.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
80.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
80.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
80.4k
    return Status::OK();
613
80.4k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
75.3k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
75.3k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
75.3k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
75.3k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
75.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
75.3k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
75.3k
    _operator_profile->add_child(_common_profile.get(), true);
557
75.3k
    _operator_profile->add_child(_custom_profile.get(), true);
558
75.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
75.3k
    if constexpr (!is_fake_shared) {
560
75.3k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
75.3k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
75.3k
                                    .first.get()
563
75.3k
                                    ->template cast<SharedStateArg>();
564
565
75.3k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
75.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
75.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
18.4E
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
75.3k
    }
585
586
75.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
75.3k
    _rows_returned_counter =
591
75.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
75.3k
    _blocks_returned_counter =
593
75.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
75.3k
    _output_block_bytes_counter =
595
75.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
75.3k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
75.3k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
75.3k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
75.3k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
75.3k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
75.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
75.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
75.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
75.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
75.3k
    _memory_used_counter =
606
75.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
75.3k
    _common_profile->add_info_string("IsColocate",
608
75.3k
                                     std::to_string(_parent->is_colocated_operator()));
609
75.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
75.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
75.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
75.3k
    return Status::OK();
613
75.3k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54
    _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
54
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54
    _operator_profile->add_child(_common_profile.get(), true);
557
54
    _operator_profile->add_child(_custom_profile.get(), true);
558
54
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54
    if constexpr (!is_fake_shared) {
560
54
        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
54
        } 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
54
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
54
            _dependency = _shared_state->create_source_dependency(
576
54
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
54
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
54
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
54
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
54
    }
585
586
54
    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
54
    _rows_returned_counter =
591
54
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54
    _blocks_returned_counter =
593
54
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54
    _output_block_bytes_counter =
595
54
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54
    _memory_used_counter =
606
54
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54
    _common_profile->add_info_string("IsColocate",
608
54
                                     std::to_string(_parent->is_colocated_operator()));
609
54
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54
    return Status::OK();
613
54
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
896k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
896k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
896k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
896k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
896k
    _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
896k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
896k
    _operator_profile->add_child(_common_profile.get(), true);
557
896k
    _operator_profile->add_child(_custom_profile.get(), true);
558
896k
    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
896k
    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
896k
    _rows_returned_counter =
591
896k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
896k
    _blocks_returned_counter =
593
896k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
896k
    _output_block_bytes_counter =
595
896k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
896k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
896k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
896k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
896k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
896k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
896k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
896k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
896k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
896k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
896k
    _memory_used_counter =
606
896k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
896k
    _common_profile->add_info_string("IsColocate",
608
896k
                                     std::to_string(_parent->is_colocated_operator()));
609
896k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
896k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
896k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
896k
    return Status::OK();
613
896k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
50.5k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
50.5k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
50.5k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
50.5k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
50.5k
    _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.5k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
50.5k
    _operator_profile->add_child(_common_profile.get(), true);
557
50.5k
    _operator_profile->add_child(_custom_profile.get(), true);
558
50.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
50.5k
    if constexpr (!is_fake_shared) {
560
50.5k
        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.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
2.06k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
2.06k
            _dependency = _shared_state->create_source_dependency(
576
2.06k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
2.06k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
2.06k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
48.5k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
48.5k
        }
584
50.5k
    }
585
586
50.5k
    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.5k
    _rows_returned_counter =
591
50.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
50.5k
    _blocks_returned_counter =
593
50.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
50.5k
    _output_block_bytes_counter =
595
50.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
50.5k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
50.5k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
50.5k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
50.5k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
50.5k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
50.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
50.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
50.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
50.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
50.5k
    _memory_used_counter =
606
50.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
50.5k
    _common_profile->add_info_string("IsColocate",
608
50.5k
                                     std::to_string(_parent->is_colocated_operator()));
609
50.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
50.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
50.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
50.5k
    return Status::OK();
613
50.5k
}
_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.98k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
4.98k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
4.98k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
4.98k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
4.98k
    _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.98k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
4.98k
    _operator_profile->add_child(_common_profile.get(), true);
557
4.98k
    _operator_profile->add_child(_custom_profile.get(), true);
558
4.98k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
4.98k
    if constexpr (!is_fake_shared) {
560
4.98k
        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.98k
        } 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.89k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.89k
            _dependency = _shared_state->create_source_dependency(
576
4.89k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.89k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.89k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.89k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
82
        }
584
4.98k
    }
585
586
4.98k
    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.98k
    _rows_returned_counter =
591
4.98k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
4.98k
    _blocks_returned_counter =
593
4.98k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
4.98k
    _output_block_bytes_counter =
595
4.98k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
4.98k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
4.98k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
4.98k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
4.98k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
4.98k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
4.98k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
4.98k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
4.98k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
4.98k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
4.98k
    _memory_used_counter =
606
4.98k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
4.98k
    _common_profile->add_info_string("IsColocate",
608
4.98k
                                     std::to_string(_parent->is_colocated_operator()));
609
4.98k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
4.98k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
4.98k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
4.98k
    return Status::OK();
613
4.98k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
424
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
424
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
424
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
424
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
424
    _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
424
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
424
    _operator_profile->add_child(_common_profile.get(), true);
557
424
    _operator_profile->add_child(_custom_profile.get(), true);
558
424
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
424
    if constexpr (!is_fake_shared) {
560
424
        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
424
        } 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
421
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
421
            _dependency = _shared_state->create_source_dependency(
576
421
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
421
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
421
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
421
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
3
        }
584
424
    }
585
586
424
    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
424
    _rows_returned_counter =
591
424
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
424
    _blocks_returned_counter =
593
424
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
424
    _output_block_bytes_counter =
595
424
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
424
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
424
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
424
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
424
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
424
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
424
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
424
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
424
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
424
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
424
    _memory_used_counter =
606
424
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
424
    _common_profile->add_info_string("IsColocate",
608
424
                                     std::to_string(_parent->is_colocated_operator()));
609
424
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
424
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
424
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
424
    return Status::OK();
613
424
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.13k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.13k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.13k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.13k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.13k
    _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.13k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.13k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.13k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.13k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.13k
    if constexpr (!is_fake_shared) {
560
5.13k
        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.13k
        } 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.09k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.09k
            _dependency = _shared_state->create_source_dependency(
576
5.09k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.09k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.09k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.09k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
41
        }
584
5.13k
    }
585
586
5.13k
    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.13k
    _rows_returned_counter =
591
5.13k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.13k
    _blocks_returned_counter =
593
5.13k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.13k
    _output_block_bytes_counter =
595
5.13k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.13k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.13k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.13k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.13k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.13k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.13k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.13k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.13k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.13k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.13k
    _memory_used_counter =
606
5.13k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.13k
    _common_profile->add_info_string("IsColocate",
608
5.13k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.13k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.13k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.13k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.13k
    return Status::OK();
613
5.13k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
605k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
605k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
605k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
605k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
605k
    _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
605k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
605k
    _operator_profile->add_child(_common_profile.get(), true);
557
605k
    _operator_profile->add_child(_custom_profile.get(), true);
558
605k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
605k
    if constexpr (!is_fake_shared) {
560
605k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
600k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
600k
                                    .first.get()
563
600k
                                    ->template cast<SharedStateArg>();
564
565
600k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
600k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
600k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
600k
        } 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
4.71k
        } else {
580
4.71k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
4.71k
                DCHECK(false);
582
4.71k
            }
583
4.71k
        }
584
605k
    }
585
586
605k
    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
605k
    _rows_returned_counter =
591
605k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
605k
    _blocks_returned_counter =
593
605k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
605k
    _output_block_bytes_counter =
595
605k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
605k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
605k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
605k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
605k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
605k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
605k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
605k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
605k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
605k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
605k
    _memory_used_counter =
606
605k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
605k
    _common_profile->add_info_string("IsColocate",
608
605k
                                     std::to_string(_parent->is_colocated_operator()));
609
605k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
605k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
605k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
605k
    return Status::OK();
613
605k
}
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.98M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.98M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.26M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
282k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
282k
    }
621
1.98M
    if (_parent->has_projection()) {
622
340k
        const auto& projection = *_parent->_projection;
623
340k
        _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
340k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
346k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
6.23k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
38.9k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
32.7k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
32.7k
                        state, _intermediate_projections[i][j]));
633
32.7k
            }
634
6.23k
        }
635
340k
    }
636
1.98M
    return Status::OK();
637
1.98M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
65.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
65.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
66.6k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
974
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
974
    }
621
65.7k
    if (_parent->has_projection()) {
622
65.7k
        const auto& projection = *_parent->_projection;
623
65.7k
        _projections.resize(projection.projections.size());
624
343k
        for (size_t i = 0; i < _projections.size(); i++) {
625
278k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
278k
        }
627
65.7k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
66.4k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
787
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
6.10k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
5.32k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
5.32k
                        state, _intermediate_projections[i][j]));
633
5.32k
            }
634
787
        }
635
65.7k
    }
636
65.6k
    return Status::OK();
637
65.6k
}
_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
177k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
177k
    _conjuncts.resize(_parent->_conjuncts.size());
618
177k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
177k
    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
177k
    return Status::OK();
637
177k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
37
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
37
    _conjuncts.resize(_parent->_conjuncts.size());
618
37
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
37
    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
37
    return Status::OK();
637
37
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.79k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.79k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.85k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
55
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
55
    }
621
5.79k
    if (_parent->has_projection()) {
622
5.79k
        const auto& projection = *_parent->_projection;
623
5.79k
        _projections.resize(projection.projections.size());
624
25.8k
        for (size_t i = 0; i < _projections.size(); i++) {
625
20.0k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
20.0k
        }
627
5.79k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.81k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
15
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
124
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
109
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
109
                        state, _intermediate_projections[i][j]));
633
109
            }
634
15
        }
635
5.79k
    }
636
5.79k
    return Status::OK();
637
5.79k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.52k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.52k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.24k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
719
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
719
    }
621
8.52k
    if (_parent->has_projection()) {
622
4.97k
        const auto& projection = *_parent->_projection;
623
4.97k
        _projections.resize(projection.projections.size());
624
19.9k
        for (size_t i = 0; i < _projections.size(); i++) {
625
14.9k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
14.9k
        }
627
4.97k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
5.06k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
90
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
683
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
593
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
593
                        state, _intermediate_projections[i][j]));
633
593
            }
634
90
        }
635
4.97k
    }
636
8.52k
    return Status::OK();
637
8.52k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
80.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
80.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
82.1k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.42k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.42k
    }
621
80.6k
    if (_parent->has_projection()) {
622
25.5k
        const auto& projection = *_parent->_projection;
623
25.5k
        _projections.resize(projection.projections.size());
624
230k
        for (size_t i = 0; i < _projections.size(); i++) {
625
205k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
205k
        }
627
25.5k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
25.7k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
144
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
939
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
795
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
795
                        state, _intermediate_projections[i][j]));
633
795
            }
634
144
        }
635
25.5k
    }
636
80.6k
    return Status::OK();
637
80.6k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
75.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
75.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
75.4k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
55
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
55
    }
621
75.3k
    if (_parent->has_projection()) {
622
183
        const auto& projection = *_parent->_projection;
623
183
        _projections.resize(projection.projections.size());
624
789
        for (size_t i = 0; i < _projections.size(); i++) {
625
606
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
606
        }
627
183
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
183
        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
183
    }
636
75.3k
    return Status::OK();
637
75.3k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
58
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
58
    _conjuncts.resize(_parent->_conjuncts.size());
618
58
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
58
    if (_parent->has_projection()) {
622
28
        const auto& projection = *_parent->_projection;
623
28
        _projections.resize(projection.projections.size());
624
84
        for (size_t i = 0; i < _projections.size(); i++) {
625
56
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
56
        }
627
28
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
28
        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
28
    }
636
58
    return Status::OK();
637
58
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
901k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
901k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.18M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
278k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
278k
    }
621
901k
    if (_parent->has_projection()) {
622
228k
        const auto& projection = *_parent->_projection;
623
228k
        _projections.resize(projection.projections.size());
624
1.39M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.16M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.16M
        }
627
228k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
233k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
5.19k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
31.0k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
25.8k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
25.8k
                        state, _intermediate_projections[i][j]));
633
25.8k
            }
634
5.19k
        }
635
228k
    }
636
901k
    return Status::OK();
637
901k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
50.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
50.8k
    _conjuncts.resize(_parent->_conjuncts.size());
618
50.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
50.8k
    if (_parent->has_projection()) {
622
9.69k
        const auto& projection = *_parent->_projection;
623
9.69k
        _projections.resize(projection.projections.size());
624
94.5k
        for (size_t i = 0; i < _projections.size(); i++) {
625
84.8k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
84.8k
        }
627
9.69k
        _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.69k
    }
636
50.8k
    return Status::OK();
637
50.8k
}
_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.98k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
4.98k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.93k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
956
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
956
    }
621
4.98k
    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.98k
    return Status::OK();
637
4.98k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
424
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
424
    _conjuncts.resize(_parent->_conjuncts.size());
618
424
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
424
    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
424
    return Status::OK();
637
424
}
_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
227
        for (size_t i = 0; i < _projections.size(); i++) {
625
167
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
167
        }
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
609k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
609k
    _conjuncts.resize(_parent->_conjuncts.size());
618
609k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
609k
    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
609k
    return Status::OK();
637
609k
}
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.87k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
5.87k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
5.87k
    _terminated = true;
645
5.87k
    return Status::OK();
646
5.87k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
358
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
358
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
358
    _terminated = true;
645
358
    return Status::OK();
646
358
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
14
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
14
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
14
    _terminated = true;
645
14
    return Status::OK();
646
14
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_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
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1
    _terminated = true;
645
1
    return Status::OK();
646
1
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
101
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
101
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
101
    _terminated = true;
645
101
    return Status::OK();
646
101
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
4.34k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
4.34k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
4.34k
    _terminated = true;
645
4.34k
    return Status::OK();
646
4.34k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
9
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
9
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
9
    _terminated = true;
645
9
    return Status::OK();
646
9
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
3
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
3
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
3
    _terminated = true;
645
3
    return Status::OK();
646
3
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
16
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
16
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
16
    _terminated = true;
645
16
    return Status::OK();
646
16
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
969
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
969
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
969
    _terminated = true;
645
969
    return Status::OK();
646
969
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
36
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
36
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
36
    _terminated = true;
645
36
    return Status::OK();
646
36
}
647
648
template <typename SharedStateArg>
649
2.19M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.19M
    if (_closed) {
651
206k
        return Status::OK();
652
206k
    }
653
1.98M
    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.98M
    _closed = true;
657
1.98M
    return Status::OK();
658
2.19M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
65.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
65.6k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
65.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
65.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
65.6k
    }
656
65.6k
    _closed = true;
657
65.6k
    return Status::OK();
658
65.6k
}
_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
352k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
352k
    if (_closed) {
651
176k
        return Status::OK();
652
176k
    }
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
352k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
37
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
37
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
37
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
37
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
37
    }
656
37
    _closed = true;
657
37
    return Status::OK();
658
37
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.78k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.78k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.78k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.78k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.78k
    }
656
5.78k
    _closed = true;
657
5.78k
    return Status::OK();
658
5.78k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
17.2k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
17.2k
    if (_closed) {
651
8.75k
        return Status::OK();
652
8.75k
    }
653
8.49k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.49k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.49k
    }
656
8.49k
    _closed = true;
657
8.49k
    return Status::OK();
658
17.2k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
80.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
80.5k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
80.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
80.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
80.5k
    }
656
80.5k
    _closed = true;
657
80.5k
    return Status::OK();
658
80.5k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
74.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
74.8k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
74.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
74.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
74.8k
    }
656
74.8k
    _closed = true;
657
74.8k
    return Status::OK();
658
74.8k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
53
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
53
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
53
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
53
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
53
    }
656
53
    _closed = true;
657
53
    return Status::OK();
658
53
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
917k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
917k
    if (_closed) {
651
15.2k
        return Status::OK();
652
15.2k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
902k
    _closed = true;
657
902k
    return Status::OK();
658
917k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
50.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
50.8k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
50.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
50.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
50.8k
    }
656
50.8k
    _closed = true;
657
50.8k
    return Status::OK();
658
50.8k
}
_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.96k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4.96k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4.96k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4.96k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4.96k
    }
656
4.96k
    _closed = true;
657
4.96k
    return Status::OK();
658
4.96k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
642
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
642
    if (_closed) {
651
322
        return Status::OK();
652
322
    }
653
320
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
320
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
320
    }
656
320
    _closed = true;
657
320
    return Status::OK();
658
642
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.5k
    if (_closed) {
651
5.40k
        return Status::OK();
652
5.40k
    }
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
610k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
610k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
610k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
610k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
610k
    }
656
610k
    _closed = true;
657
610k
    return Status::OK();
658
610k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
326
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
326
    if (_closed) {
651
171
        return Status::OK();
652
171
    }
653
155
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
155
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
155
    }
656
155
    _closed = true;
657
155
    return Status::OK();
658
326
}
659
660
template <typename SharedState>
661
1.60M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.60M
    _operator_profile =
664
1.60M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.60M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.60M
    _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.60M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.60M
    _operator_profile->add_child(_common_profile, true);
673
1.60M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.60M
    _operator_profile->set_metadata(_parent->node_id());
676
1.60M
    _wait_for_finish_dependency_timer =
677
1.60M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.60M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.60M
    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
309k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
221k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
221k
            }
685
309k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
309k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
309k
                                                  ? 0
688
309k
                                                  : info.task_idx]
689
309k
                                  .get();
690
309k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
825k
        } else {
692
825k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
215
                DCHECK(false);
694
215
            }
695
825k
            _shared_state = info.shared_state->template cast<SharedState>();
696
825k
            _dependency = _shared_state->create_sink_dependency(
697
825k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
825k
        }
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.60M
    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.60M
    _rows_input_counter =
708
1.60M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.60M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.60M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.60M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.60M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.60M
    _memory_used_counter =
714
1.60M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.60M
    _common_profile->add_info_string("IsColocate",
716
1.60M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.60M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.60M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.60M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.60M
    return Status::OK();
721
1.60M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
113k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
113k
    _operator_profile =
664
113k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
113k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
113k
    _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
113k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
113k
    _operator_profile->add_child(_common_profile, true);
673
113k
    _operator_profile->add_child(_custom_profile, true);
674
675
113k
    _operator_profile->set_metadata(_parent->node_id());
676
113k
    _wait_for_finish_dependency_timer =
677
113k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
113k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
113k
    if constexpr (!is_fake_shared) {
680
113k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
113k
            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
13.0k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
13.0k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
13.0k
                                                  ? 0
688
13.0k
                                                  : info.task_idx]
689
13.0k
                                  .get();
690
13.0k
            _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
113k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
113k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
113k
    }
702
703
113k
    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
113k
    _rows_input_counter =
708
113k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
113k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
113k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
113k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
113k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
113k
    _memory_used_counter =
714
113k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
113k
    _common_profile->add_info_string("IsColocate",
716
113k
                                     std::to_string(_parent->is_colocated_operator()));
717
113k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
113k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
113k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
113k
    return Status::OK();
721
113k
}
_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
176k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
176k
    _operator_profile =
664
176k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
176k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
176k
    _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
176k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
176k
    _operator_profile->add_child(_common_profile, true);
673
176k
    _operator_profile->add_child(_custom_profile, true);
674
675
176k
    _operator_profile->set_metadata(_parent->node_id());
676
176k
    _wait_for_finish_dependency_timer =
677
176k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
176k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
176k
    if constexpr (!is_fake_shared) {
680
176k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
176k
            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
176k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
176k
            _shared_state = info.shared_state->template cast<SharedState>();
696
176k
            _dependency = _shared_state->create_sink_dependency(
697
176k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
176k
        }
699
176k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
176k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
176k
    }
702
703
176k
    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
176k
    _rows_input_counter =
708
176k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
176k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
176k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
176k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
176k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
176k
    _memory_used_counter =
714
176k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
176k
    _common_profile->add_info_string("IsColocate",
716
176k
                                     std::to_string(_parent->is_colocated_operator()));
717
176k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
176k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
176k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
176k
    return Status::OK();
721
176k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
44
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
44
    _operator_profile =
664
44
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
44
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
44
    _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
44
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
44
    _operator_profile->add_child(_common_profile, true);
673
44
    _operator_profile->add_child(_custom_profile, true);
674
675
44
    _operator_profile->set_metadata(_parent->node_id());
676
44
    _wait_for_finish_dependency_timer =
677
44
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
44
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
44
    if constexpr (!is_fake_shared) {
680
44
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
44
            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
44
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
44
            _shared_state = info.shared_state->template cast<SharedState>();
696
44
            _dependency = _shared_state->create_sink_dependency(
697
44
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
44
        }
699
44
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
44
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
44
    }
702
703
44
    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
44
    _rows_input_counter =
708
44
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
44
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
44
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
44
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
44
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
44
    _memory_used_counter =
714
44
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
44
    _common_profile->add_info_string("IsColocate",
716
44
                                     std::to_string(_parent->is_colocated_operator()));
717
44
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
44
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
44
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
44
    return Status::OK();
721
44
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
5.75k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
5.75k
    _operator_profile =
664
5.75k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
5.75k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
5.75k
    _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.75k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
5.75k
    _operator_profile->add_child(_common_profile, true);
673
5.75k
    _operator_profile->add_child(_custom_profile, true);
674
675
5.75k
    _operator_profile->set_metadata(_parent->node_id());
676
5.75k
    _wait_for_finish_dependency_timer =
677
5.75k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
5.75k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
5.75k
    if constexpr (!is_fake_shared) {
680
5.75k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
5.75k
            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.75k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
5.75k
            _shared_state = info.shared_state->template cast<SharedState>();
696
5.75k
            _dependency = _shared_state->create_sink_dependency(
697
5.75k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
5.75k
        }
699
5.75k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
5.75k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
5.75k
    }
702
703
5.75k
    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.75k
    _rows_input_counter =
708
5.75k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
5.75k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
5.75k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
5.75k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
5.75k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
5.75k
    _memory_used_counter =
714
5.75k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
5.75k
    _common_profile->add_info_string("IsColocate",
716
5.75k
                                     std::to_string(_parent->is_colocated_operator()));
717
5.75k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
5.75k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
5.75k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
5.75k
    return Status::OK();
721
5.75k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.47k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.47k
    _operator_profile =
664
8.47k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.47k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.47k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.47k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.47k
    _operator_profile->add_child(_common_profile, true);
673
8.47k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.47k
    _operator_profile->set_metadata(_parent->node_id());
676
8.47k
    _wait_for_finish_dependency_timer =
677
8.47k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.47k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.47k
    if constexpr (!is_fake_shared) {
680
8.47k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.47k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.47k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.47k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.47k
            _dependency = _shared_state->create_sink_dependency(
697
8.47k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.47k
        }
699
8.47k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.47k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.47k
    }
702
703
8.47k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.47k
    _rows_input_counter =
708
8.47k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.47k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.47k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.47k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.47k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.47k
    _memory_used_counter =
714
8.47k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.47k
    _common_profile->add_info_string("IsColocate",
716
8.47k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.47k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.47k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.47k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.47k
    return Status::OK();
721
8.47k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
80.5k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
80.5k
    _operator_profile =
664
80.5k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
80.5k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
80.5k
    _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
80.5k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
80.5k
    _operator_profile->add_child(_common_profile, true);
673
80.5k
    _operator_profile->add_child(_custom_profile, true);
674
675
80.5k
    _operator_profile->set_metadata(_parent->node_id());
676
80.5k
    _wait_for_finish_dependency_timer =
677
80.5k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
80.5k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
80.5k
    if constexpr (!is_fake_shared) {
680
80.5k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
80.5k
            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
80.5k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
80.5k
            _shared_state = info.shared_state->template cast<SharedState>();
696
80.5k
            _dependency = _shared_state->create_sink_dependency(
697
80.5k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
80.5k
        }
699
80.5k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
80.5k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
80.5k
    }
702
703
80.5k
    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
80.5k
    _rows_input_counter =
708
80.5k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
80.5k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
80.5k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
80.5k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
80.5k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
80.5k
    _memory_used_counter =
714
80.5k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
80.5k
    _common_profile->add_info_string("IsColocate",
716
80.5k
                                     std::to_string(_parent->is_colocated_operator()));
717
80.5k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
80.5k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
80.5k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
80.5k
    return Status::OK();
721
80.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
75.3k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
75.3k
    _operator_profile =
664
75.3k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
75.3k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
75.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
75.3k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
75.3k
    _operator_profile->add_child(_common_profile, true);
673
75.3k
    _operator_profile->add_child(_custom_profile, true);
674
675
75.3k
    _operator_profile->set_metadata(_parent->node_id());
676
75.3k
    _wait_for_finish_dependency_timer =
677
75.3k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
75.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
75.3k
    if constexpr (!is_fake_shared) {
680
75.3k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
75.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
75.3k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
75.3k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
75.3k
                                                  ? 0
688
75.3k
                                                  : info.task_idx]
689
75.3k
                                  .get();
690
75.3k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
75.3k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
75.3k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
75.3k
    }
702
703
75.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
75.3k
    _rows_input_counter =
708
75.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
75.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
75.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
75.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
75.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
75.3k
    _memory_used_counter =
714
75.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
75.3k
    _common_profile->add_info_string("IsColocate",
716
75.3k
                                     std::to_string(_parent->is_colocated_operator()));
717
75.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
75.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
75.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
75.3k
    return Status::OK();
721
75.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
64
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
64
    _operator_profile =
664
64
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
64
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
64
    _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
64
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
64
    _operator_profile->add_child(_common_profile, true);
673
64
    _operator_profile->add_child(_custom_profile, true);
674
675
64
    _operator_profile->set_metadata(_parent->node_id());
676
64
    _wait_for_finish_dependency_timer =
677
64
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
64
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
64
    if constexpr (!is_fake_shared) {
680
64
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
64
            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
64
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
64
            _shared_state = info.shared_state->template cast<SharedState>();
696
64
            _dependency = _shared_state->create_sink_dependency(
697
64
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
64
        }
699
64
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
64
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
64
    }
702
703
64
    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
64
    _rows_input_counter =
708
64
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
64
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
64
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
64
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
64
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
64
    _memory_used_counter =
714
64
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
64
    _common_profile->add_info_string("IsColocate",
716
64
                                     std::to_string(_parent->is_colocated_operator()));
717
64
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
64
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
64
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
64
    return Status::OK();
721
64
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
474k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
474k
    _operator_profile =
664
474k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
474k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
474k
    _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
474k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
474k
    _operator_profile->add_child(_common_profile, true);
673
474k
    _operator_profile->add_child(_custom_profile, true);
674
675
474k
    _operator_profile->set_metadata(_parent->node_id());
676
474k
    _wait_for_finish_dependency_timer =
677
474k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
474k
    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
474k
    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
474k
    _rows_input_counter =
708
474k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
474k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
474k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
474k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
474k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
474k
    _memory_used_counter =
714
474k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
474k
    _common_profile->add_info_string("IsColocate",
716
474k
                                     std::to_string(_parent->is_colocated_operator()));
717
474k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
474k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
474k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
474k
    return Status::OK();
721
474k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
4.56k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
4.56k
    _operator_profile =
664
4.56k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
4.56k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
4.56k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
4.56k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
4.56k
    _operator_profile->add_child(_common_profile, true);
673
4.56k
    _operator_profile->add_child(_custom_profile, true);
674
675
4.56k
    _operator_profile->set_metadata(_parent->node_id());
676
4.56k
    _wait_for_finish_dependency_timer =
677
4.56k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
4.56k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
4.56k
    if constexpr (!is_fake_shared) {
680
4.56k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
4.56k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
4.56k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
4.56k
            _shared_state = info.shared_state->template cast<SharedState>();
696
4.56k
            _dependency = _shared_state->create_sink_dependency(
697
4.56k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
4.56k
        }
699
4.56k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
4.56k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
4.56k
    }
702
703
4.56k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
4.56k
    _rows_input_counter =
708
4.56k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
4.56k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
4.56k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
4.56k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
4.56k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
4.56k
    _memory_used_counter =
714
4.56k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
4.56k
    _common_profile->add_info_string("IsColocate",
716
4.56k
                                     std::to_string(_parent->is_colocated_operator()));
717
4.56k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
4.56k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
4.56k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
4.56k
    return Status::OK();
721
4.56k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
424
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
424
    _operator_profile =
664
424
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
424
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
424
    _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
424
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
424
    _operator_profile->add_child(_common_profile, true);
673
424
    _operator_profile->add_child(_custom_profile, true);
674
675
424
    _operator_profile->set_metadata(_parent->node_id());
676
424
    _wait_for_finish_dependency_timer =
677
424
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
424
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
424
    if constexpr (!is_fake_shared) {
680
424
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
424
            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
424
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
424
            _shared_state = info.shared_state->template cast<SharedState>();
696
424
            _dependency = _shared_state->create_sink_dependency(
697
424
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
424
        }
699
424
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
424
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
424
    }
702
703
424
    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
424
    _rows_input_counter =
708
424
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
424
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
424
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
424
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
424
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
424
    _memory_used_counter =
714
424
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
424
    _common_profile->add_info_string("IsColocate",
716
424
                                     std::to_string(_parent->is_colocated_operator()));
717
424
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
424
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
424
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
424
    return Status::OK();
721
424
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
1.89k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.89k
    _operator_profile =
664
1.89k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.89k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.89k
    _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.89k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.89k
    _operator_profile->add_child(_common_profile, true);
673
1.89k
    _operator_profile->add_child(_custom_profile, true);
674
675
1.89k
    _operator_profile->set_metadata(_parent->node_id());
676
1.89k
    _wait_for_finish_dependency_timer =
677
1.89k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.89k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.89k
    if constexpr (!is_fake_shared) {
680
1.89k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.89k
            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.89k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
1.89k
            _shared_state = info.shared_state->template cast<SharedState>();
696
1.89k
            _dependency = _shared_state->create_sink_dependency(
697
1.89k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
1.89k
        }
699
1.89k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.89k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.89k
    }
702
703
1.89k
    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.89k
    _rows_input_counter =
708
1.89k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.89k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.89k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.89k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.89k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.89k
    _memory_used_counter =
714
1.89k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.89k
    _common_profile->add_info_string("IsColocate",
716
1.89k
                                     std::to_string(_parent->is_colocated_operator()));
717
1.89k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.89k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.89k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.89k
    return Status::OK();
721
1.89k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.4k
    _operator_profile =
664
12.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.4k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.4k
    _operator_profile->add_child(_common_profile, true);
673
12.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.4k
    _operator_profile->set_metadata(_parent->node_id());
676
12.4k
    _wait_for_finish_dependency_timer =
677
12.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.4k
    if constexpr (!is_fake_shared) {
680
12.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.4k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.4k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.4k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.4k
            _dependency = _shared_state->create_sink_dependency(
697
12.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.4k
        }
699
12.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.4k
    }
702
703
12.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.4k
    _rows_input_counter =
708
12.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.4k
    _memory_used_counter =
714
12.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.4k
    _common_profile->add_info_string("IsColocate",
716
12.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.4k
    return Status::OK();
721
12.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
221k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
221k
    _operator_profile =
664
221k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
221k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
221k
    _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
221k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
221k
    _operator_profile->add_child(_common_profile, true);
673
221k
    _operator_profile->add_child(_custom_profile, true);
674
675
221k
    _operator_profile->set_metadata(_parent->node_id());
676
221k
    _wait_for_finish_dependency_timer =
677
221k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
221k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
221k
    if constexpr (!is_fake_shared) {
680
221k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
221k
            info.shared_state_map.end()) {
682
221k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
221k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
221k
            }
685
221k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
221k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
221k
                                                  ? 0
688
221k
                                                  : info.task_idx]
689
221k
                                  .get();
690
221k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
221k
        } else {
692
215
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
215
                DCHECK(false);
694
215
            }
695
215
            _shared_state = info.shared_state->template cast<SharedState>();
696
215
            _dependency = _shared_state->create_sink_dependency(
697
215
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
215
        }
699
221k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
221k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
221k
    }
702
703
221k
    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
221k
    _rows_input_counter =
708
221k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
221k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
221k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
221k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
221k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
221k
    _memory_used_counter =
714
221k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
221k
    _common_profile->add_info_string("IsColocate",
716
221k
                                     std::to_string(_parent->is_colocated_operator()));
717
221k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
221k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
221k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
221k
    return Status::OK();
721
221k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
433k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
433k
    _operator_profile =
664
433k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
433k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
433k
    _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
433k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
433k
    _operator_profile->add_child(_common_profile, true);
673
433k
    _operator_profile->add_child(_custom_profile, true);
674
675
433k
    _operator_profile->set_metadata(_parent->node_id());
676
433k
    _wait_for_finish_dependency_timer =
677
433k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
433k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
433k
    if constexpr (!is_fake_shared) {
680
433k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
433k
            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
433k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
433k
            _shared_state = info.shared_state->template cast<SharedState>();
696
433k
            _dependency = _shared_state->create_sink_dependency(
697
433k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
433k
        }
699
433k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
433k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
433k
    }
702
703
433k
    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
433k
    _rows_input_counter =
708
433k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
433k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
433k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
433k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
433k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
433k
    _memory_used_counter =
714
433k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
433k
    _common_profile->add_info_string("IsColocate",
716
433k
                                     std::to_string(_parent->is_colocated_operator()));
717
433k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
433k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
433k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
433k
    return Status::OK();
721
433k
}
_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.61M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.61M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.61M
    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.61M
    _closed = true;
732
1.61M
    return Status::OK();
733
1.61M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
113k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
113k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
113k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
113k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
113k
    }
731
113k
    _closed = true;
732
113k
    return Status::OK();
733
113k
}
_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
176k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
176k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
176k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
176k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
176k
    }
731
176k
    _closed = true;
732
176k
    return Status::OK();
733
176k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
35
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
35
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
33
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
33
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
33
    }
731
33
    _closed = true;
732
33
    return Status::OK();
733
35
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
5.76k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
5.76k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
5.76k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
5.76k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
5.76k
    }
731
5.76k
    _closed = true;
732
5.76k
    return Status::OK();
733
5.76k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.49k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.49k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.49k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.49k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.49k
    }
731
8.49k
    _closed = true;
732
8.49k
    return Status::OK();
733
8.49k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
80.3k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
80.3k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
80.3k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
80.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
80.3k
    }
731
80.3k
    _closed = true;
732
80.3k
    return Status::OK();
733
80.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
74.9k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
74.9k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
74.9k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
74.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
74.9k
    }
731
74.9k
    _closed = true;
732
74.9k
    return Status::OK();
733
74.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
53
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
53
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
53
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
53
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
53
    }
731
53
    _closed = true;
732
53
    return Status::OK();
733
53
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
478k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
478k
    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
478k
    _closed = true;
732
478k
    return Status::OK();
733
478k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
4.57k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
4.57k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
4.57k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
4.57k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
4.57k
    }
731
4.57k
    _closed = true;
732
4.57k
    return Status::OK();
733
4.57k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
321
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
321
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
321
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
321
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
321
    }
731
321
    _closed = true;
732
321
    return Status::OK();
733
321
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1.91k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.91k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1.91k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.91k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.91k
    }
731
1.91k
    _closed = true;
732
1.91k
    return Status::OK();
733
1.91k
}
_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
222k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
222k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
222k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
222k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
222k
    }
731
222k
    _closed = true;
732
222k
    return Status::OK();
733
222k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
435k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
435k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
435k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
435k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
435k
    }
731
435k
    _closed = true;
732
435k
    return Status::OK();
733
435k
}
_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.45k
                                                          bool* eos) {
738
4.45k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.45k
    return pull(state, block, eos);
740
4.45k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
37
                                                          bool* eos) {
738
37
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
37
    return pull(state, block, eos);
740
37
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.42k
                                                          bool* eos) {
738
4.42k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.41k
    return pull(state, block, eos);
740
4.42k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
579k
                                                         bool* eos) {
745
579k
    auto& local_state = get_local_state(state);
746
579k
    if (need_more_input_data(state)) {
747
548k
        local_state._child_block->clear_column_data(
748
548k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
548k
                        .num_materialized_slots());
750
548k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
548k
                state, local_state._child_block.get(), &local_state._child_eos));
752
548k
        *eos = local_state._child_eos;
753
548k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
56.5k
            return Status::OK();
755
56.5k
        }
756
492k
        {
757
492k
            SCOPED_TIMER(local_state.exec_time_counter());
758
492k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
492k
        }
760
492k
    }
761
762
522k
    if (!need_more_input_data(state)) {
763
494k
        SCOPED_TIMER(local_state.exec_time_counter());
764
494k
        bool new_eos = false;
765
494k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
494k
        if (new_eos) {
767
414k
            *eos = true;
768
414k
        } else if (!need_more_input_data(state)) {
769
25.4k
            *eos = false;
770
25.4k
        }
771
494k
    }
772
522k
    return Status::OK();
773
522k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
136k
                                                         bool* eos) {
745
136k
    auto& local_state = get_local_state(state);
746
136k
    if (need_more_input_data(state)) {
747
119k
        local_state._child_block->clear_column_data(
748
119k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
119k
                        .num_materialized_slots());
750
119k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
119k
                state, local_state._child_block.get(), &local_state._child_eos));
752
119k
        *eos = local_state._child_eos;
753
119k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
35.8k
            return Status::OK();
755
35.8k
        }
756
83.2k
        {
757
83.2k
            SCOPED_TIMER(local_state.exec_time_counter());
758
83.2k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
83.2k
        }
760
83.2k
    }
761
762
100k
    if (!need_more_input_data(state)) {
763
100k
        SCOPED_TIMER(local_state.exec_time_counter());
764
100k
        bool new_eos = false;
765
100k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
100k
        if (new_eos) {
767
41.4k
            *eos = true;
768
59.1k
        } else if (!need_more_input_data(state)) {
769
11.1k
            *eos = false;
770
11.1k
        }
771
100k
    }
772
100k
    return Status::OK();
773
100k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.07k
                                                         bool* eos) {
745
4.07k
    auto& local_state = get_local_state(state);
746
4.07k
    if (need_more_input_data(state)) {
747
2.25k
        local_state._child_block->clear_column_data(
748
2.25k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.25k
                        .num_materialized_slots());
750
2.25k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.25k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.25k
        *eos = local_state._child_eos;
753
2.25k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
485
            return Status::OK();
755
485
        }
756
1.77k
        {
757
1.77k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.77k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.77k
        }
760
1.77k
    }
761
762
3.60k
    if (!need_more_input_data(state)) {
763
3.60k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.60k
        bool new_eos = false;
765
3.60k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.60k
        if (new_eos) {
767
1.14k
            *eos = true;
768
2.46k
        } else if (!need_more_input_data(state)) {
769
1.82k
            *eos = false;
770
1.82k
        }
771
3.60k
    }
772
3.59k
    return Status::OK();
773
3.59k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.83k
                                                         bool* eos) {
745
1.83k
    auto& local_state = get_local_state(state);
746
1.83k
    if (need_more_input_data(state)) {
747
1.83k
        local_state._child_block->clear_column_data(
748
1.83k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.83k
                        .num_materialized_slots());
750
1.83k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.83k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.83k
        *eos = local_state._child_eos;
753
1.83k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
770
            return Status::OK();
755
770
        }
756
1.06k
        {
757
1.06k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.06k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.06k
        }
760
1.06k
    }
761
762
1.06k
    if (!need_more_input_data(state)) {
763
1.06k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.06k
        bool new_eos = false;
765
1.06k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.06k
        if (new_eos) {
767
776
            *eos = true;
768
776
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.06k
    }
772
1.06k
    return Status::OK();
773
1.06k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
16.8k
                                                         bool* eos) {
745
16.8k
    auto& local_state = get_local_state(state);
746
16.8k
    if (need_more_input_data(state)) {
747
16.8k
        local_state._child_block->clear_column_data(
748
16.8k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
16.8k
                        .num_materialized_slots());
750
16.8k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
16.8k
                state, local_state._child_block.get(), &local_state._child_eos));
752
16.8k
        *eos = local_state._child_eos;
753
16.8k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
4.42k
            return Status::OK();
755
4.42k
        }
756
12.3k
        {
757
12.3k
            SCOPED_TIMER(local_state.exec_time_counter());
758
12.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
12.3k
        }
760
12.3k
    }
761
762
12.3k
    if (!need_more_input_data(state)) {
763
5.98k
        SCOPED_TIMER(local_state.exec_time_counter());
764
5.98k
        bool new_eos = false;
765
5.98k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
5.98k
        if (new_eos) {
767
5.91k
            *eos = true;
768
5.91k
        } else if (!need_more_input_data(state)) {
769
10
            *eos = false;
770
10
        }
771
5.98k
    }
772
12.3k
    return Status::OK();
773
12.3k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
389k
                                                         bool* eos) {
745
389k
    auto& local_state = get_local_state(state);
746
390k
    if (need_more_input_data(state)) {
747
390k
        local_state._child_block->clear_column_data(
748
390k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
390k
                        .num_materialized_slots());
750
390k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
390k
                state, local_state._child_block.get(), &local_state._child_eos));
752
390k
        *eos = local_state._child_eos;
753
390k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
13.2k
            return Status::OK();
755
13.2k
        }
756
377k
        {
757
377k
            SCOPED_TIMER(local_state.exec_time_counter());
758
377k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
377k
        }
760
377k
    }
761
762
376k
    if (!need_more_input_data(state)) {
763
355k
        SCOPED_TIMER(local_state.exec_time_counter());
764
355k
        bool new_eos = false;
765
355k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
355k
        if (new_eos) {
767
354k
            *eos = true;
768
354k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
355k
    }
772
376k
    return Status::OK();
773
376k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
22.5k
                                                         bool* eos) {
745
22.5k
    auto& local_state = get_local_state(state);
746
22.5k
    if (need_more_input_data(state)) {
747
10.3k
        local_state._child_block->clear_column_data(
748
10.3k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
10.3k
                        .num_materialized_slots());
750
10.3k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
10.3k
                state, local_state._child_block.get(), &local_state._child_eos));
752
10.3k
        *eos = local_state._child_eos;
753
10.3k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
833
            return Status::OK();
755
833
        }
756
9.50k
        {
757
9.50k
            SCOPED_TIMER(local_state.exec_time_counter());
758
9.50k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
9.50k
        }
760
9.50k
    }
761
762
21.6k
    if (!need_more_input_data(state)) {
763
21.1k
        SCOPED_TIMER(local_state.exec_time_counter());
764
21.1k
        bool new_eos = false;
765
21.1k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
21.1k
        if (new_eos) {
767
5.75k
            *eos = true;
768
15.3k
        } else if (!need_more_input_data(state)) {
769
12.1k
            *eos = false;
770
12.1k
        }
771
21.1k
    }
772
21.6k
    return Status::OK();
773
21.6k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
8.07k
                                                         bool* eos) {
745
8.07k
    auto& local_state = get_local_state(state);
746
8.07k
    if (need_more_input_data(state)) {
747
7.71k
        local_state._child_block->clear_column_data(
748
7.71k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
7.71k
                        .num_materialized_slots());
750
7.71k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
7.71k
                state, local_state._child_block.get(), &local_state._child_eos));
752
7.71k
        *eos = local_state._child_eos;
753
7.71k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
970
            return Status::OK();
755
970
        }
756
6.74k
        {
757
6.74k
            SCOPED_TIMER(local_state.exec_time_counter());
758
6.74k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
6.74k
        }
760
6.74k
    }
761
762
7.10k
    if (!need_more_input_data(state)) {
763
7.10k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.10k
        bool new_eos = false;
765
7.10k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.10k
        if (new_eos) {
767
5.06k
            *eos = true;
768
5.06k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
7.10k
    }
772
7.09k
    return Status::OK();
773
7.09k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
42.6k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
42.6k
    RETURN_IF_ERROR(Base::init(state, info));
779
42.6k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
42.6k
                                                         "AsyncWriterDependency", true);
781
42.6k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
42.6k
                             _finish_dependency));
783
784
42.6k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
42.6k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
42.6k
    return Status::OK();
787
42.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
356
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
356
    RETURN_IF_ERROR(Base::init(state, info));
779
356
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
356
                                                         "AsyncWriterDependency", true);
781
356
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
356
                             _finish_dependency));
783
784
356
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
356
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
356
    return Status::OK();
787
356
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
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_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
8
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
8
    RETURN_IF_ERROR(Base::init(state, info));
779
8
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
8
                                                         "AsyncWriterDependency", true);
781
8
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
8
                             _finish_dependency));
783
784
8
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
8
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
8
    return Status::OK();
787
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
43.0k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
43.0k
    RETURN_IF_ERROR(Base::open(state));
793
43.0k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
327k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
284k
        RETURN_IF_ERROR(
796
284k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
284k
    }
798
43.0k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
43.0k
    return Status::OK();
800
43.0k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
359
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
359
    RETURN_IF_ERROR(Base::open(state));
793
359
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.85k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.49k
        RETURN_IF_ERROR(
796
1.49k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.49k
    }
798
359
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
359
    return Status::OK();
800
359
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
42.7k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
42.7k
    RETURN_IF_ERROR(Base::open(state));
793
42.7k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
325k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
282k
        RETURN_IF_ERROR(
796
282k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
282k
    }
798
42.7k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
42.7k
    return Status::OK();
800
42.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
8
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
8
    RETURN_IF_ERROR(Base::open(state));
793
8
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
144
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
136
        RETURN_IF_ERROR(
796
136
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
136
    }
798
8
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
8
    return Status::OK();
800
8
}
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
57.5k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
57.5k
    return _writer->sink(block, eos);
806
57.5k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.15k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.15k
    return _writer->sink(block, eos);
806
1.15k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
56.4k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
56.4k
    return _writer->sink(block, eos);
806
56.4k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
8
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
8
    return _writer->sink(block, eos);
806
8
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
43.1k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
43.1k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
43.1k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
43.1k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
43.1k
    if (_writer) {
818
43.1k
        Status st = _writer->get_writer_status();
819
43.1k
        if (exec_status.ok()) {
820
43.1k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
43.1k
                                                       : Status::Cancelled("force close"));
822
43.1k
        } else {
823
62
            _writer->force_close(exec_status);
824
62
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
43.1k
        RETURN_IF_ERROR(st);
829
43.1k
    }
830
43.1k
    return Base::close(state, exec_status);
831
43.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
347
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
347
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
347
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
347
    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
347
    if (_writer) {
818
347
        Status st = _writer->get_writer_status();
819
347
        if (exec_status.ok()) {
820
347
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
347
                                                       : Status::Cancelled("force close"));
822
347
        } 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
347
        RETURN_IF_ERROR(st);
829
347
    }
830
347
    return Base::close(state, exec_status);
831
347
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
42.8k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
42.8k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
42.8k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
42.8k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
42.8k
    if (_writer) {
818
42.8k
        Status st = _writer->get_writer_status();
819
42.8k
        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
62
            _writer->force_close(exec_status);
824
62
        }
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.8k
        RETURN_IF_ERROR(st);
829
42.8k
    }
830
42.7k
    return Base::close(state, exec_status);
831
42.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
8
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
8
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
8
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
8
    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
8
    if (_writer) {
818
8
        Status st = _writer->get_writer_status();
819
8
        if (exec_status.ok()) {
820
8
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
8
                                                       : Status::Cancelled("force close"));
822
8
        } 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
8
        RETURN_IF_ERROR(st);
829
8
    }
830
8
    return Base::close(state, exec_status);
831
8
}
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