Coverage Report

Created: 2026-07-09 20:07

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