Coverage Report

Created: 2026-09-24 08:40

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.81M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.81M
    if (_parent->nereids_id() == -1) {
122
953k
        return fmt::format("(id={})", _parent->node_id());
123
953k
    } else {
124
857k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
857k
    }
126
1.81M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
70.2k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
70.2k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
70.2k
    } else {
124
70.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
70.2k
    }
126
70.2k
}
_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
204k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
204k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
204k
    } else {
124
204k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
204k
    }
126
204k
}
_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
6.70k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
6.70k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
6.70k
    } else {
124
6.70k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
6.70k
    }
126
6.70k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
8.68k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
8.68k
    if (_parent->nereids_id() == -1) {
122
14
        return fmt::format("(id={})", _parent->node_id());
123
8.67k
    } else {
124
8.67k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
8.67k
    }
126
8.68k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
93.3k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
93.3k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
93.3k
    } else {
124
93.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
93.3k
    }
126
93.3k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
84.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
84.1k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
84.1k
    } else {
124
84.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
84.1k
    }
126
84.1k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
14
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
14
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
14
    } else {
124
14
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
14
    }
126
14
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
612k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
612k
    if (_parent->nereids_id() == -1) {
122
281k
        return fmt::format("(id={})", _parent->node_id());
123
331k
    } else {
124
331k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
331k
    }
126
612k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
54.5k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
54.5k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
54.5k
    } else {
124
54.5k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
54.5k
    }
126
54.5k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
26
    if (_parent->nereids_id() == -1) {
122
26
        return fmt::format("(id={})", _parent->node_id());
123
26
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.38k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.39k
    if (_parent->nereids_id() == -1) {
122
5.39k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
5.38k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
484
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
484
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
382
    } else {
124
382
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
382
    }
126
484
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.09k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.09k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.07k
    } else {
124
5.07k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.07k
    }
126
5.09k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
664k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
666k
    if (_parent->nereids_id() == -1) {
122
666k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
664k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
169
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
169
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
169
    } else {
124
169
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
169
    }
126
169
}
127
128
template <typename SharedStateArg>
129
1.24M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.24M
    if (_parent->nereids_id() == -1) {
131
716k
        return fmt::format("(id={})", _parent->node_id());
132
716k
    } else {
133
527k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
527k
    }
135
1.24M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
118k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
118k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
118k
    } else {
133
118k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
118k
    }
135
118k
}
_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
206k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
206k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
206k
    } else {
133
206k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
206k
    }
135
206k
}
_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
6.78k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
6.78k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
6.78k
    } else {
133
6.78k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
6.78k
    }
135
6.78k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.73k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.73k
    if (_parent->nereids_id() == -1) {
131
14
        return fmt::format("(id={})", _parent->node_id());
132
8.71k
    } else {
133
8.71k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.71k
    }
135
8.73k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
93.9k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
93.9k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
93.9k
    } else {
133
93.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
93.9k
    }
135
93.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
83.8k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
83.8k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
83.8k
    } else {
133
83.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
83.8k
    }
135
83.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
24
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
24
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
24
    } else {
133
24
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
24
    }
135
24
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
24
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
24
    if (_parent->nereids_id() == -1) {
131
24
        return fmt::format("(id={})", _parent->node_id());
132
24
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
24
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
8.87k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
8.87k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
8.87k
    } else {
133
8.87k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
8.87k
    }
135
8.87k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
484
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
484
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
382
    } else {
133
382
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
382
    }
135
484
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.6k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.7k
    if (_parent->nereids_id() == -1) {
131
12.7k
        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.6k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
269k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
269k
    if (_parent->nereids_id() == -1) {
131
269k
        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
269k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
434k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
434k
    if (_parent->nereids_id() == -1) {
131
434k
        return fmt::format("(id={})", _parent->node_id());
132
434k
    } else {
133
103
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
103
    }
135
434k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
25
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
25
    if (_parent->nereids_id() == -1) {
131
25
        return fmt::format("(id={})", _parent->node_id());
132
25
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
338
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
338
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
338
    } else {
133
338
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
338
    }
135
338
}
136
137
template <typename SharedStateArg>
138
29.8k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
29.8k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
29.8k
    _terminated = true;
143
29.8k
    return Status::OK();
144
29.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.21k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.21k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.21k
    _terminated = true;
143
2.21k
    return Status::OK();
144
2.21k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1
    _terminated = true;
143
1
    return Status::OK();
144
1
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.51k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.51k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.51k
    _terminated = true;
143
1.51k
    return Status::OK();
144
1.51k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
528
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
528
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
528
    _terminated = true;
143
528
    return Status::OK();
144
528
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
705
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
705
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
705
    _terminated = true;
143
705
    return Status::OK();
144
705
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
233
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
233
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
233
    _terminated = true;
143
233
    return Status::OK();
144
233
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_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_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
164
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
164
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
164
    _terminated = true;
143
164
    return Status::OK();
144
164
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_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_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
297
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
297
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
297
    _terminated = true;
143
297
    return Status::OK();
144
297
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
136
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
136
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
136
    _terminated = true;
143
136
    return Status::OK();
144
136
}
145
146
304k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
304k
    return _child && _child->is_serial_operator() && !is_source()
148
304k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
304k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
304k
}
151
152
18.7k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
18.7k
    if (!_child) {
154
17.7k
        return false;
155
17.7k
    }
156
1.00k
    if (_child->is_serial_operator()) {
157
102
        return true;
158
102
    }
159
898
    const auto child_distribution = _child->required_data_distribution(state);
160
898
    return child_distribution.need_local_exchange() &&
161
898
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.00k
}
163
164
template <typename SharedStateArg>
165
16.8k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
16.8k
    fmt::memory_buffer debug_string_buffer;
167
16.8k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
16.8k
    return fmt::to_string(debug_string_buffer);
169
16.8k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
3
    fmt::memory_buffer debug_string_buffer;
167
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
3
    return fmt::to_string(debug_string_buffer);
169
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
16.8k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
16.8k
    fmt::memory_buffer debug_string_buffer;
167
16.8k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
16.8k
    return fmt::to_string(debug_string_buffer);
169
16.8k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
165
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
166
1
    fmt::memory_buffer debug_string_buffer;
167
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
168
1
    return fmt::to_string(debug_string_buffer);
169
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
170
171
template <typename SharedStateArg>
172
16.8k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
16.8k
    fmt::memory_buffer debug_string_buffer;
174
16.8k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
16.8k
    return fmt::to_string(debug_string_buffer);
176
16.8k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
172
16.8k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
173
16.8k
    fmt::memory_buffer debug_string_buffer;
174
16.8k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
175
16.8k
    return fmt::to_string(debug_string_buffer);
176
16.8k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
177
178
16.9k
std::string OperatorXBase::debug_string(int indentation_level) const {
179
16.9k
    fmt::memory_buffer debug_string_buffer;
180
16.9k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
181
16.9k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
182
16.9k
                   _is_serial_operator);
183
16.9k
    return fmt::to_string(debug_string_buffer);
184
16.9k
}
185
186
16.8k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
187
16.8k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
188
16.8k
}
189
190
661k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
191
661k
    std::string node_name = print_plan_node_type(tnode.node_type);
192
661k
    _nereids_id = tnode.nereids_id;
193
661k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
194
3.87k
        if (!has_projection()) {
195
0
            return Status::InternalError("no final output tuple id");
196
0
        }
197
3.87k
        if (tnode.intermediate_output_tuple_id_list.size() !=
198
3.87k
            tnode.intermediate_projections_list.size()) {
199
0
            return Status::InternalError(
200
0
                    "intermediate_output_tuple_id_list size:{} not match "
201
0
                    "intermediate_projections_list size:{}",
202
0
                    tnode.intermediate_output_tuple_id_list.size(),
203
0
                    tnode.intermediate_projections_list.size());
204
0
        }
205
3.87k
    }
206
661k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
207
661k
    _op_name = substr + "_OPERATOR";
208
209
661k
    if (tnode.__isset.vconjunct) {
210
0
        return Status::InternalError("vconjunct is not supported yet");
211
661k
    } else if (tnode.__isset.conjuncts) {
212
272k
        for (const auto& conjunct : tnode.conjuncts) {
213
272k
            VExprContextSPtr context;
214
272k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
215
272k
            _conjuncts.emplace_back(context);
216
272k
        }
217
99.4k
    }
218
219
    // create the projections expr
220
661k
    if (tnode.__isset.projections) {
221
260k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
222
260k
    }
223
661k
    if (!tnode.intermediate_projections_list.empty()) {
224
3.87k
        DCHECK(has_projection()) << "no final projections";
225
3.87k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
226
6.48k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
227
6.48k
            VExprContextSPtrs projections;
228
6.48k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
229
6.48k
            _projection->intermediate_projections.push_back(projections);
230
6.48k
        }
231
3.87k
    }
232
661k
    return Status::OK();
233
661k
}
234
235
688k
Status OperatorXBase::prepare(RuntimeState* state) {
236
688k
    for (auto& conjunct : _conjuncts) {
237
272k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
238
272k
    }
239
688k
    if (state->enable_adjust_conjunct_order_by_cost()) {
240
638k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
241
337k
            return a->execute_cost() < b->execute_cost();
242
337k
        });
243
638k
    };
244
245
688k
    if (has_projection()) {
246
259k
        auto& projection = *_projection;
247
266k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
248
6.48k
            const auto& input_row_desc =
249
6.48k
                    i == 0 ? operator_row_desc_before_projection()
250
6.48k
                           : projection.intermediate_output_row_descriptors[i - 1];
251
6.48k
            RETURN_IF_ERROR(
252
6.48k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
253
6.48k
        }
254
259k
        const auto& final_projection_input_row_desc =
255
259k
                projection.intermediate_output_row_descriptors.empty()
256
259k
                        ? operator_row_desc_before_projection()
257
259k
                        : projection.intermediate_output_row_descriptors.back();
258
259k
        RETURN_IF_ERROR(
259
259k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
260
259k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
261
259k
                                                      projection.output_row_descriptor));
262
259k
    }
263
264
688k
    for (auto& conjunct : _conjuncts) {
265
272k
        RETURN_IF_ERROR(conjunct->open(state));
266
272k
    }
267
688k
    if (has_projection()) {
268
259k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
269
259k
        for (auto& projections : _projection->intermediate_projections) {
270
6.48k
            RETURN_IF_ERROR(VExpr::open(projections, state));
271
6.48k
        }
272
259k
    }
273
688k
    if (_child && !is_source()) {
274
97.0k
        RETURN_IF_ERROR(_child->prepare(state));
275
97.0k
    }
276
277
688k
    if (VExpr::contains_blockable_function(_conjuncts) ||
278
688k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
279
0
        _blockable = true;
280
0
    }
281
282
688k
    return Status::OK();
283
688k
}
284
285
6.44k
Status OperatorXBase::terminate(RuntimeState* state) {
286
6.44k
    if (_child && !is_source()) {
287
603
        RETURN_IF_ERROR(_child->terminate(state));
288
603
    }
289
6.44k
    auto result = state->get_local_state_result(operator_id());
290
6.44k
    if (!result) {
291
0
        return result.error();
292
0
    }
293
6.44k
    return result.value()->terminate(state);
294
6.44k
}
295
296
4.90M
Status OperatorXBase::close(RuntimeState* state) {
297
4.90M
    if (_child && !is_source()) {
298
801k
        RETURN_IF_ERROR(_child->close(state));
299
801k
    }
300
4.90M
    auto result = state->get_local_state_result(operator_id());
301
4.90M
    if (!result) {
302
0
        return result.error();
303
0
    }
304
4.90M
    return result.value()->close(state);
305
4.90M
}
306
307
278k
void PipelineXLocalStateBase::clear_origin_block() {
308
278k
    _origin_block.clear_column_data(
309
278k
            _parent->operator_row_desc_before_projection().num_materialized_slots());
310
278k
}
311
312
860k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
860k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
860k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
860k
    return Status::OK();
317
860k
}
318
319
0
bool PipelineXLocalStateBase::is_blockable() const {
320
0
    return std::any_of(_projections.begin(), _projections.end(),
321
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
322
0
}
323
324
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
325
278k
                                     Block* output_block) const {
326
278k
    auto* local_state = state->get_local_state(operator_id());
327
278k
    SCOPED_TIMER(local_state->exec_time_counter());
328
278k
    SCOPED_TIMER(local_state->_projection_timer);
329
278k
    const size_t rows = origin_block->rows();
330
278k
    if (rows == 0) {
331
149k
        return Status::OK();
332
149k
    }
333
128k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
128k
    {
336
128k
        Block input_block = *origin_block;
337
338
128k
        ColumnsWithTypeAndName new_columns;
339
128k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.69k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.69k
            new_columns.resize(projections.size());
345
68.8k
            for (int i = 0; i < projections.size(); i++) {
346
65.1k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
65.1k
                if (new_columns[i].column->size() != rows) {
348
0
                    return Status::InternalError(
349
0
                            "intermediate projection result column size {} not equal input rows "
350
0
                            "{}, expr: {}",
351
0
                            new_columns[i].column->size(), rows,
352
0
                            projections[i]->root()->debug_string());
353
0
                }
354
65.1k
            }
355
3.68k
            Block tmp_block {new_columns};
356
3.68k
            input_block.swap(tmp_block);
357
3.68k
        }
358
359
128k
        if (input_block.rows() != rows) {
360
0
            return Status::InternalError(
361
0
                    "after intermediate projections input block rows {} not equal origin rows {}, "
362
0
                    "input_block: {}",
363
0
                    input_block.rows(), rows, input_block.dump_structure());
364
0
        }
365
366
128k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
128k
                output_block, _projection->output_row_descriptor);
368
128k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
128k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
128k
        Columns shared_columns(mutable_columns.size());
371
372
742k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
613k
            ColumnPtr column_ptr;
374
613k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
613k
            if (column_ptr->size() != rows) {
376
0
                return Status::InternalError(
377
0
                        "projection result column size {} not equal input rows {}, expr: {}",
378
0
                        column_ptr->size(), rows,
379
0
                        local_state->_projections[i]->root()->debug_string());
380
0
            }
381
613k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
613k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
613k
            if (column_ptr->is_exclusive()) {
386
224k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
389k
            } else {
388
389k
                shared_columns[i] = std::move(column_ptr);
389
389k
            }
390
613k
        }
391
392
128k
        scoped_mutable_block.restore();
393
742k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
613k
            if (shared_columns[i]) {
395
389k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
389k
            }
397
613k
        }
398
128k
    }
399
400
0
    origin_block->clear_column_data(
401
128k
            local_state->_parent->operator_row_desc_before_projection().num_materialized_slots());
402
128k
    DCHECK_EQ(output_block->rows(), rows);
403
404
128k
    return Status::OK();
405
128k
}
406
407
4.25M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
4.25M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
4.25M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
4.25M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
4.25M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
4.25M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
4.25M
            if (_debug_point_count++ % 2 == 0) {
414
4.25M
                return Status::OK();
415
4.25M
            }
416
4.25M
        }
417
4.25M
    });
418
419
4.25M
    Status status;
420
4.25M
    auto* local_state = state->get_local_state(operator_id());
421
4.25M
    Defer defer([&]() {
422
4.25M
        if (status.ok()) {
423
4.25M
            local_state->update_output_block_counters(*block);
424
4.25M
        }
425
4.25M
    });
426
4.25M
    if (has_projection()) {
427
278k
        local_state->clear_origin_block();
428
278k
        status = get_block(state, &local_state->_origin_block, eos);
429
278k
        if (UNLIKELY(!status.ok())) {
430
29
            return status;
431
29
        }
432
278k
        status = do_projections(state, &local_state->_origin_block, block);
433
278k
        return status;
434
278k
    }
435
3.97M
    status = get_block(state, block, eos);
436
3.97M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.97M
    return status;
438
3.97M
}
439
440
2.80M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.80M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.64k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.64k
        *eos = true;
444
9.64k
    }
445
446
2.80M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.80M
        auto op_name = to_lower(_parent->_op_name);
448
2.80M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.80M
        arg_op_name = to_lower(arg_op_name);
450
451
2.80M
        if (op_name == arg_op_name) {
452
2.80M
            *eos = true;
453
2.80M
        }
454
2.80M
    });
455
456
2.80M
    if (auto rows = block->rows()) {
457
755k
        _num_rows_returned += rows;
458
755k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
755k
    }
460
2.80M
}
461
462
29.8k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
29.8k
    auto result = state->get_sink_local_state_result();
464
29.8k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
29.8k
    return result.value()->terminate(state);
468
29.8k
}
469
470
16.8k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
16.8k
    fmt::memory_buffer debug_string_buffer;
472
473
16.8k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
16.8k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
16.8k
    return fmt::to_string(debug_string_buffer);
476
16.8k
}
477
478
16.8k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
16.8k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
16.8k
}
481
482
340k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
340k
    std::string op_name = "UNKNOWN_SINK";
484
340k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
341k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
341k
        op_name = it->second;
488
341k
    }
489
340k
    _name = op_name + "_OPERATOR";
490
340k
    return Status::OK();
491
340k
}
492
493
296k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
296k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
296k
    _nereids_id = tnode.nereids_id;
496
296k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
296k
    _name = substr + "_SINK_OPERATOR";
498
296k
    return Status::OK();
499
296k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.74M
                                                            LocalSinkStateInfo& info) {
504
1.74M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.74M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.74M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.74M
    return Status::OK();
508
1.74M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
118k
                                                            LocalSinkStateInfo& info) {
504
118k
    auto local_state = LocalStateType::create_unique(this, state);
505
118k
    RETURN_IF_ERROR(local_state->init(state, info));
506
118k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
118k
    return Status::OK();
508
118k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
387k
                                                            LocalSinkStateInfo& info) {
504
387k
    auto local_state = LocalStateType::create_unique(this, state);
505
387k
    RETURN_IF_ERROR(local_state->init(state, info));
506
387k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
387k
    return Status::OK();
508
387k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
3
                                                            LocalSinkStateInfo& info) {
504
3
    auto local_state = LocalStateType::create_unique(this, state);
505
3
    RETURN_IF_ERROR(local_state->init(state, info));
506
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
3
    return Status::OK();
508
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
343
                                                            LocalSinkStateInfo& info) {
504
343
    auto local_state = LocalStateType::create_unique(this, state);
505
343
    RETURN_IF_ERROR(local_state->init(state, info));
506
343
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
343
    return Status::OK();
508
343
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
47.9k
                                                            LocalSinkStateInfo& info) {
504
47.9k
    auto local_state = LocalStateType::create_unique(this, state);
505
47.9k
    RETURN_IF_ERROR(local_state->init(state, info));
506
47.9k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
47.9k
    return Status::OK();
508
47.9k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.73k
                                                            LocalSinkStateInfo& info) {
504
8.73k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.73k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.73k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.73k
    return Status::OK();
508
8.73k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
21
                                                            LocalSinkStateInfo& info) {
504
21
    auto local_state = LocalStateType::create_unique(this, state);
505
21
    RETURN_IF_ERROR(local_state->init(state, info));
506
21
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
21
    return Status::OK();
508
21
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
206k
                                                            LocalSinkStateInfo& info) {
504
206k
    auto local_state = LocalStateType::create_unique(this, state);
505
206k
    RETURN_IF_ERROR(local_state->init(state, info));
506
206k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
206k
    return Status::OK();
508
206k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
32
                                                            LocalSinkStateInfo& info) {
504
32
    auto local_state = LocalStateType::create_unique(this, state);
505
32
    RETURN_IF_ERROR(local_state->init(state, info));
506
32
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
32
    return Status::OK();
508
32
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
269k
                                                            LocalSinkStateInfo& info) {
504
269k
    auto local_state = LocalStateType::create_unique(this, state);
505
269k
    RETURN_IF_ERROR(local_state->init(state, info));
506
269k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
269k
    return Status::OK();
508
269k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
94.0k
                                                            LocalSinkStateInfo& info) {
504
94.0k
    auto local_state = LocalStateType::create_unique(this, state);
505
94.0k
    RETURN_IF_ERROR(local_state->init(state, info));
506
94.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
94.0k
    return Status::OK();
508
94.0k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
83.5k
                                                            LocalSinkStateInfo& info) {
504
83.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
83.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
83.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
83.5k
    return Status::OK();
508
83.5k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
24
                                                            LocalSinkStateInfo& info) {
504
24
    auto local_state = LocalStateType::create_unique(this, state);
505
24
    RETURN_IF_ERROR(local_state->init(state, info));
506
24
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
24
    return Status::OK();
508
24
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
496k
                                                            LocalSinkStateInfo& info) {
504
496k
    auto local_state = LocalStateType::create_unique(this, state);
505
496k
    RETURN_IF_ERROR(local_state->init(state, info));
506
496k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
496k
    return Status::OK();
508
496k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6.81k
                                                            LocalSinkStateInfo& info) {
504
6.81k
    auto local_state = LocalStateType::create_unique(this, state);
505
6.81k
    RETURN_IF_ERROR(local_state->init(state, info));
506
6.81k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6.81k
    return Status::OK();
508
6.81k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.86k
                                                            LocalSinkStateInfo& info) {
504
8.86k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.86k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.86k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.86k
    return Status::OK();
508
8.86k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.36k
                                                            LocalSinkStateInfo& info) {
504
2.36k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.36k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.36k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.36k
    return Status::OK();
508
2.36k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
382
                                                            LocalSinkStateInfo& info) {
504
382
    auto local_state = LocalStateType::create_unique(this, state);
505
382
    RETURN_IF_ERROR(local_state->init(state, info));
506
382
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
382
    return Status::OK();
508
382
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.83k
                                                            LocalSinkStateInfo& info) {
504
4.83k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.83k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.83k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.83k
    return Status::OK();
508
4.83k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.64k
                                                            LocalSinkStateInfo& info) {
504
2.64k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.64k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.64k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.64k
    return Status::OK();
508
2.64k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.62k
                                                            LocalSinkStateInfo& info) {
504
2.62k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.62k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.62k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.62k
    return Status::OK();
508
2.62k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.54k
                                                            LocalSinkStateInfo& info) {
504
2.54k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.54k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.54k
    return Status::OK();
508
2.54k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1
                                                            LocalSinkStateInfo& info) {
504
1
    auto local_state = LocalStateType::create_unique(this, state);
505
1
    RETURN_IF_ERROR(local_state->init(state, info));
506
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1
    return Status::OK();
508
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
561
                                                            LocalSinkStateInfo& info) {
504
561
    auto local_state = LocalStateType::create_unique(this, state);
505
561
    RETURN_IF_ERROR(local_state->init(state, info));
506
561
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
561
    return Status::OK();
508
561
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
14
                                                            LocalSinkStateInfo& info) {
504
14
    auto local_state = LocalStateType::create_unique(this, state);
505
14
    RETURN_IF_ERROR(local_state->init(state, info));
506
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
14
    return Status::OK();
508
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
106
                                                            LocalSinkStateInfo& info) {
504
106
    auto local_state = LocalStateType::create_unique(this, state);
505
106
    RETURN_IF_ERROR(local_state->init(state, info));
506
106
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
106
    return Status::OK();
508
106
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
509
510
template <typename LocalStateType>
511
1.36M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
0
                                 LocalExchangeSharedState>) {
514
0
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
0
                                        MultiCastSharedState>) {
517
0
        throw Exception(Status::FatalError("should not reach here!"));
518
1.36M
    } else {
519
1.36M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.36M
        ss->id = operator_id();
521
1.36M
        for (auto& dest : dests_id()) {
522
1.35M
            ss->related_op_ids.insert(dest);
523
1.35M
        }
524
1.36M
        return ss;
525
1.36M
    }
526
1.36M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
103k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
103k
    } else {
519
103k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
103k
        ss->id = operator_id();
521
103k
        for (auto& dest : dests_id()) {
522
103k
            ss->related_op_ids.insert(dest);
523
103k
        }
524
103k
        return ss;
525
103k
    }
526
103k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
388k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
388k
    } else {
519
388k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
388k
        ss->id = operator_id();
521
388k
        for (auto& dest : dests_id()) {
522
387k
            ss->related_op_ids.insert(dest);
523
387k
        }
524
388k
        return ss;
525
388k
    }
526
388k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
3
    } else {
519
3
        auto ss = LocalStateType::SharedStateType::create_shared();
520
3
        ss->id = operator_id();
521
3
        for (auto& dest : dests_id()) {
522
3
            ss->related_op_ids.insert(dest);
523
3
        }
524
3
        return ss;
525
3
    }
526
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
349
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
349
    } else {
519
349
        auto ss = LocalStateType::SharedStateType::create_shared();
520
349
        ss->id = operator_id();
521
349
        for (auto& dest : dests_id()) {
522
348
            ss->related_op_ids.insert(dest);
523
348
        }
524
349
        return ss;
525
349
    }
526
349
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
48.1k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
48.1k
    } else {
519
48.1k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
48.1k
        ss->id = operator_id();
521
48.1k
        for (auto& dest : dests_id()) {
522
47.9k
            ss->related_op_ids.insert(dest);
523
47.9k
        }
524
48.1k
        return ss;
525
48.1k
    }
526
48.1k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
8.76k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
8.76k
    } else {
519
8.76k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.76k
        ss->id = operator_id();
521
8.76k
        for (auto& dest : dests_id()) {
522
8.76k
            ss->related_op_ids.insert(dest);
523
8.76k
        }
524
8.76k
        return ss;
525
8.76k
    }
526
8.76k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
21
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
21
    } else {
519
21
        auto ss = LocalStateType::SharedStateType::create_shared();
520
21
        ss->id = operator_id();
521
21
        for (auto& dest : dests_id()) {
522
21
            ss->related_op_ids.insert(dest);
523
21
        }
524
21
        return ss;
525
21
    }
526
21
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
207k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
207k
    } else {
519
207k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
207k
        ss->id = operator_id();
521
207k
        for (auto& dest : dests_id()) {
522
207k
            ss->related_op_ids.insert(dest);
523
207k
        }
524
207k
        return ss;
525
207k
    }
526
207k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
34
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
34
    } else {
519
34
        auto ss = LocalStateType::SharedStateType::create_shared();
520
34
        ss->id = operator_id();
521
34
        for (auto& dest : dests_id()) {
522
34
            ss->related_op_ids.insert(dest);
523
34
        }
524
34
        return ss;
525
34
    }
526
34
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
94.4k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
94.4k
    } else {
519
94.4k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
94.4k
        ss->id = operator_id();
521
94.4k
        for (auto& dest : dests_id()) {
522
94.4k
            ss->related_op_ids.insert(dest);
523
94.4k
        }
524
94.4k
        return ss;
525
94.4k
    }
526
94.4k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
23
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
23
    } else {
519
23
        auto ss = LocalStateType::SharedStateType::create_shared();
520
23
        ss->id = operator_id();
521
23
        for (auto& dest : dests_id()) {
522
23
            ss->related_op_ids.insert(dest);
523
23
        }
524
23
        return ss;
525
23
    }
526
23
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
498k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
498k
    } else {
519
498k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
498k
        ss->id = operator_id();
521
498k
        for (auto& dest : dests_id()) {
522
494k
            ss->related_op_ids.insert(dest);
523
494k
        }
524
498k
        return ss;
525
498k
    }
526
498k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6.82k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
6.82k
    } else {
519
6.82k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6.82k
        ss->id = operator_id();
521
6.82k
        for (auto& dest : dests_id()) {
522
6.81k
            ss->related_op_ids.insert(dest);
523
6.81k
        }
524
6.82k
        return ss;
525
6.82k
    }
526
6.82k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
485
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
485
    } else {
519
485
        auto ss = LocalStateType::SharedStateType::create_shared();
520
485
        ss->id = operator_id();
521
486
        for (auto& dest : dests_id()) {
522
486
            ss->related_op_ids.insert(dest);
523
486
        }
524
485
        return ss;
525
485
    }
526
485
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.63k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.63k
    } else {
519
2.63k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.63k
        ss->id = operator_id();
521
2.63k
        for (auto& dest : dests_id()) {
522
2.63k
            ss->related_op_ids.insert(dest);
523
2.63k
        }
524
2.63k
        return ss;
525
2.63k
    }
526
2.63k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.55k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.55k
    } else {
519
2.55k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.55k
        ss->id = operator_id();
521
2.56k
        for (auto& dest : dests_id()) {
522
2.56k
            ss->related_op_ids.insert(dest);
523
2.56k
        }
524
2.55k
        return ss;
525
2.55k
    }
526
2.55k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
566
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
566
    } else {
519
566
        auto ss = LocalStateType::SharedStateType::create_shared();
520
566
        ss->id = operator_id();
521
566
        for (auto& dest : dests_id()) {
522
555
            ss->related_op_ids.insert(dest);
523
555
        }
524
566
        return ss;
525
566
    }
526
566
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
106
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
106
    } else {
519
106
        auto ss = LocalStateType::SharedStateType::create_shared();
520
106
        ss->id = operator_id();
521
106
        for (auto& dest : dests_id()) {
522
106
            ss->related_op_ids.insert(dest);
523
106
        }
524
106
        return ss;
525
106
    }
526
106
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
2.07M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.07M
    auto local_state = LocalStateType::create_unique(state, this);
531
2.07M
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.07M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.07M
    return Status::OK();
534
2.07M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
70.5k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
70.5k
    auto local_state = LocalStateType::create_unique(state, this);
531
70.5k
    RETURN_IF_ERROR(local_state->init(state, info));
532
70.5k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
70.5k
    return Status::OK();
534
70.5k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
245k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
245k
    auto local_state = LocalStateType::create_unique(state, this);
531
245k
    RETURN_IF_ERROR(local_state->init(state, info));
532
245k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
245k
    return Status::OK();
534
245k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
131
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
131
    auto local_state = LocalStateType::create_unique(state, this);
531
131
    RETURN_IF_ERROR(local_state->init(state, info));
532
131
    state->emplace_local_state(operator_id(), std::move(local_state));
533
131
    return Status::OK();
534
131
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.08k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.08k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.08k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.08k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.08k
    return Status::OK();
534
3.08k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.70k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.70k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.70k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.70k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.70k
    return Status::OK();
534
8.70k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.60k
    return Status::OK();
534
8.60k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
25
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
25
    auto local_state = LocalStateType::create_unique(state, this);
531
25
    RETURN_IF_ERROR(local_state->init(state, info));
532
25
    state->emplace_local_state(operator_id(), std::move(local_state));
533
25
    return Status::OK();
534
25
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
197k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
197k
    auto local_state = LocalStateType::create_unique(state, this);
531
197k
    RETURN_IF_ERROR(local_state->init(state, info));
532
197k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
197k
    return Status::OK();
534
197k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
93.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
93.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
93.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
93.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
93.8k
    return Status::OK();
534
93.8k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
84.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
84.1k
    auto local_state = LocalStateType::create_unique(state, this);
531
84.1k
    RETURN_IF_ERROR(local_state->init(state, info));
532
84.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
84.1k
    return Status::OK();
534
84.1k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
14
    auto local_state = LocalStateType::create_unique(state, this);
531
14
    RETURN_IF_ERROR(local_state->init(state, info));
532
14
    state->emplace_local_state(operator_id(), std::move(local_state));
533
14
    return Status::OK();
534
14
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
4.14k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
4.14k
    auto local_state = LocalStateType::create_unique(state, this);
531
4.14k
    RETURN_IF_ERROR(local_state->init(state, info));
532
4.14k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
4.14k
    return Status::OK();
534
4.14k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
283k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
283k
    auto local_state = LocalStateType::create_unique(state, this);
531
283k
    RETURN_IF_ERROR(local_state->init(state, info));
532
283k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
283k
    return Status::OK();
534
283k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.37k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.37k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.37k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.37k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.37k
    return Status::OK();
534
1.37k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.73k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.73k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.73k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.73k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.73k
    return Status::OK();
534
6.73k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
37
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
37
    auto local_state = LocalStateType::create_unique(state, this);
531
37
    RETURN_IF_ERROR(local_state->init(state, info));
532
37
    state->emplace_local_state(operator_id(), std::move(local_state));
533
37
    return Status::OK();
534
37
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.60k
    return Status::OK();
534
1.60k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
54.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
54.6k
    auto local_state = LocalStateType::create_unique(state, this);
531
54.6k
    RETURN_IF_ERROR(local_state->init(state, info));
532
54.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
54.6k
    return Status::OK();
534
54.6k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.39k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.39k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.39k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.39k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.39k
    return Status::OK();
534
5.39k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
382
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
382
    auto local_state = LocalStateType::create_unique(state, this);
531
382
    RETURN_IF_ERROR(local_state->init(state, info));
532
382
    state->emplace_local_state(operator_id(), std::move(local_state));
533
382
    return Status::OK();
534
382
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.62k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.62k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.62k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.62k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.62k
    return Status::OK();
534
2.62k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.54k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.54k
    return Status::OK();
534
2.54k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
385
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
385
    auto local_state = LocalStateType::create_unique(state, this);
531
385
    RETURN_IF_ERROR(local_state->init(state, info));
532
385
    state->emplace_local_state(operator_id(), std::move(local_state));
533
385
    return Status::OK();
534
385
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.68k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.68k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.68k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.68k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.68k
    return Status::OK();
534
1.68k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.4k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.4k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.4k
    return Status::OK();
534
10.4k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
670k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
670k
    auto local_state = LocalStateType::create_unique(state, this);
531
670k
    RETURN_IF_ERROR(local_state->init(state, info));
532
670k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
670k
    return Status::OK();
534
670k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
14
    auto local_state = LocalStateType::create_unique(state, this);
531
14
    RETURN_IF_ERROR(local_state->init(state, info));
532
14
    state->emplace_local_state(operator_id(), std::move(local_state));
533
14
    return Status::OK();
534
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
169
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
169
    auto local_state = LocalStateType::create_unique(state, this);
531
169
    RETURN_IF_ERROR(local_state->init(state, info));
532
169
    state->emplace_local_state(operator_id(), std::move(local_state));
533
169
    return Status::OK();
534
169
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.20k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.20k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.20k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.20k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.20k
    return Status::OK();
534
2.20k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
792
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
792
    auto local_state = LocalStateType::create_unique(state, this);
531
792
    RETURN_IF_ERROR(local_state->init(state, info));
532
792
    state->emplace_local_state(operator_id(), std::move(local_state));
533
792
    return Status::OK();
534
792
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.13k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.13k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.13k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.13k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.13k
    return Status::OK();
534
1.13k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.61k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.61k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.61k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.61k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.61k
    return Status::OK();
534
6.61k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
304k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
304k
    auto local_state = LocalStateType::create_unique(state, this);
531
304k
    RETURN_IF_ERROR(local_state->init(state, info));
532
304k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
304k
    return Status::OK();
534
304k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.74M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
2.06M
        : _num_rows_returned(0),
542
2.06M
          _rows_returned_counter(nullptr),
543
2.06M
          _parent(parent),
544
2.06M
          _state(state),
545
2.06M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
2.07M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
2.07M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
2.07M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
2.07M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
2.07M
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
2.07M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
2.07M
    _operator_profile->add_child(_common_profile.get(), true);
557
2.07M
    _operator_profile->add_child(_custom_profile.get(), true);
558
2.07M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
2.07M
    if constexpr (!is_fake_shared) {
560
1.21M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
766k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
766k
                                    .first.get()
563
766k
                                    ->template cast<SharedStateArg>();
564
565
766k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
766k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
766k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
766k
        } else if (info.shared_state) {
569
379k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
379k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
379k
            _dependency = _shared_state->create_source_dependency(
576
379k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
379k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
379k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
379k
        } else {
580
66.8k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
7.02k
                DCHECK(false);
582
7.02k
            }
583
66.8k
        }
584
1.21M
    }
585
586
2.07M
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
2.07M
    _rows_returned_counter =
591
2.07M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
2.07M
    _blocks_returned_counter =
593
2.07M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
2.07M
    _output_block_bytes_counter =
595
2.07M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
2.07M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
2.07M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
2.07M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
2.07M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
2.07M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
2.07M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
2.07M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
2.07M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
2.07M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
2.07M
    _memory_used_counter =
606
2.07M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
2.07M
    _common_profile->add_info_string("IsColocate",
608
2.07M
                                     std::to_string(_parent->is_colocated_operator()));
609
2.07M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
2.07M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
2.07M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
2.07M
    return Status::OK();
613
2.07M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
70.6k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
70.6k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
70.6k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
70.6k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
70.6k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
70.6k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
70.6k
    _operator_profile->add_child(_common_profile.get(), true);
557
70.6k
    _operator_profile->add_child(_custom_profile.get(), true);
558
70.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
70.6k
    if constexpr (!is_fake_shared) {
560
70.6k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
14.5k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
14.5k
                                    .first.get()
563
14.5k
                                    ->template cast<SharedStateArg>();
564
565
14.5k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
14.5k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
14.5k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
56.0k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
54.9k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
54.9k
            _dependency = _shared_state->create_source_dependency(
576
54.9k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
54.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
54.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
54.9k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1.16k
        }
584
70.6k
    }
585
586
70.6k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
70.6k
    _rows_returned_counter =
591
70.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
70.6k
    _blocks_returned_counter =
593
70.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
70.6k
    _output_block_bytes_counter =
595
70.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
70.6k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
70.6k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
70.6k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
70.6k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
70.6k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
70.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
70.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
70.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
70.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
70.6k
    _memory_used_counter =
606
70.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
70.6k
    _common_profile->add_info_string("IsColocate",
608
70.6k
                                     std::to_string(_parent->is_colocated_operator()));
609
70.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
70.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
70.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
70.6k
    return Status::OK();
613
70.6k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1
    _operator_profile->add_child(_common_profile.get(), true);
557
1
    _operator_profile->add_child(_custom_profile.get(), true);
558
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1
    if constexpr (!is_fake_shared) {
560
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
1
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
1
            _dependency = _shared_state->create_source_dependency(
576
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
1
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
1
    }
585
586
1
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1
    _rows_returned_counter =
591
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1
    _blocks_returned_counter =
593
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1
    _output_block_bytes_counter =
595
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1
    _memory_used_counter =
606
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1
    _common_profile->add_info_string("IsColocate",
608
1
                                     std::to_string(_parent->is_colocated_operator()));
609
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1
    return Status::OK();
613
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
207k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
207k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
207k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
207k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
207k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
207k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
207k
    _operator_profile->add_child(_common_profile.get(), true);
557
207k
    _operator_profile->add_child(_custom_profile.get(), true);
558
207k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
207k
    if constexpr (!is_fake_shared) {
560
207k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
207k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
202k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
202k
            _dependency = _shared_state->create_source_dependency(
576
202k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
202k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
202k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
202k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
5.08k
        }
584
207k
    }
585
586
207k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
207k
    _rows_returned_counter =
591
207k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
207k
    _blocks_returned_counter =
593
207k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
207k
    _output_block_bytes_counter =
595
207k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
207k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
207k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
207k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
207k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
207k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
207k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
207k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
207k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
207k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
207k
    _memory_used_counter =
606
207k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
207k
    _common_profile->add_info_string("IsColocate",
608
207k
                                     std::to_string(_parent->is_colocated_operator()));
609
207k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
207k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
207k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
207k
    return Status::OK();
613
207k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
25
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
25
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
25
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
25
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
25
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
25
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
25
    _operator_profile->add_child(_common_profile.get(), true);
557
25
    _operator_profile->add_child(_custom_profile.get(), true);
558
25
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
25
    if constexpr (!is_fake_shared) {
560
25
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
25
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
25
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
25
            _dependency = _shared_state->create_source_dependency(
576
25
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
25
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
25
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
25
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
25
    }
585
586
25
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
25
    _rows_returned_counter =
591
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
25
    _blocks_returned_counter =
593
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
25
    _output_block_bytes_counter =
595
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
25
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
25
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
25
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
25
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
25
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
25
    _memory_used_counter =
606
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
25
    _common_profile->add_info_string("IsColocate",
608
25
                                     std::to_string(_parent->is_colocated_operator()));
609
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
25
    return Status::OK();
613
25
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.79k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.79k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.79k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.79k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.79k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
6.79k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.79k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.79k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.79k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.79k
    if constexpr (!is_fake_shared) {
560
6.79k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
6.79k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
6.57k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.57k
            _dependency = _shared_state->create_source_dependency(
576
6.57k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.57k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.57k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.57k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
220
        }
584
6.79k
    }
585
586
6.79k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
6.79k
    _rows_returned_counter =
591
6.79k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.79k
    _blocks_returned_counter =
593
6.79k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.79k
    _output_block_bytes_counter =
595
6.79k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.79k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.79k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.79k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.79k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.79k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.79k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.79k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.79k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.79k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.79k
    _memory_used_counter =
606
6.79k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.79k
    _common_profile->add_info_string("IsColocate",
608
6.79k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.79k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.79k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.79k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.79k
    return Status::OK();
613
6.79k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.75k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.75k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.75k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.75k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.75k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
8.75k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.75k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.75k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.75k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.75k
    if constexpr (!is_fake_shared) {
560
8.75k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
8.75k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
8.65k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.65k
            _dependency = _shared_state->create_source_dependency(
576
8.65k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.65k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.65k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.65k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
95
        }
584
8.75k
    }
585
586
8.75k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
8.75k
    _rows_returned_counter =
591
8.75k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.75k
    _blocks_returned_counter =
593
8.75k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.75k
    _output_block_bytes_counter =
595
8.75k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.75k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.75k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.75k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.75k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.75k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.75k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.75k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.75k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.75k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.75k
    _memory_used_counter =
606
8.75k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.75k
    _common_profile->add_info_string("IsColocate",
608
8.75k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.75k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.75k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.75k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.75k
    return Status::OK();
613
8.75k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
94.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
94.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
94.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
94.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
94.4k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
94.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
94.4k
    _operator_profile->add_child(_common_profile.get(), true);
557
94.4k
    _operator_profile->add_child(_custom_profile.get(), true);
558
94.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
94.4k
    if constexpr (!is_fake_shared) {
560
94.4k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
94.4k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
92.2k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
92.2k
            _dependency = _shared_state->create_source_dependency(
576
92.2k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
92.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
92.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
92.2k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
2.20k
        }
584
94.4k
    }
585
586
94.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
94.4k
    _rows_returned_counter =
591
94.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
94.4k
    _blocks_returned_counter =
593
94.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
94.4k
    _output_block_bytes_counter =
595
94.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
94.4k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
94.4k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
94.4k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
94.4k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
94.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
94.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
94.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
94.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
94.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
94.4k
    _memory_used_counter =
606
94.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
94.4k
    _common_profile->add_info_string("IsColocate",
608
94.4k
                                     std::to_string(_parent->is_colocated_operator()));
609
94.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
94.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
94.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
94.4k
    return Status::OK();
613
94.4k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
84.1k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
84.1k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
84.1k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
84.1k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
84.1k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
84.1k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
84.1k
    _operator_profile->add_child(_common_profile.get(), true);
557
84.1k
    _operator_profile->add_child(_custom_profile.get(), true);
558
84.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
84.1k
    if constexpr (!is_fake_shared) {
560
84.2k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
84.2k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
84.2k
                                    .first.get()
563
84.2k
                                    ->template cast<SharedStateArg>();
564
565
84.2k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
84.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
84.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
18.4E
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
84.1k
    }
585
586
84.1k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
84.1k
    _rows_returned_counter =
591
84.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
84.1k
    _blocks_returned_counter =
593
84.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
84.1k
    _output_block_bytes_counter =
595
84.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
84.1k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
84.1k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
84.1k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
84.1k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
84.1k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
84.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
84.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
84.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
84.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
84.1k
    _memory_used_counter =
606
84.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
84.1k
    _common_profile->add_info_string("IsColocate",
608
84.1k
                                     std::to_string(_parent->is_colocated_operator()));
609
84.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
84.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
84.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
84.1k
    return Status::OK();
613
84.1k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
14
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
14
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
14
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
14
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
14
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
14
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
14
    _operator_profile->add_child(_common_profile.get(), true);
557
14
    _operator_profile->add_child(_custom_profile.get(), true);
558
14
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
14
    if constexpr (!is_fake_shared) {
560
14
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
14
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
14
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
14
            _dependency = _shared_state->create_source_dependency(
576
14
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
14
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
14
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
14
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
14
    }
585
586
14
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
14
    _rows_returned_counter =
591
14
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
14
    _blocks_returned_counter =
593
14
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
14
    _output_block_bytes_counter =
595
14
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
14
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
14
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
14
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
14
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
14
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
14
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
14
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
14
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
14
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
14
    _memory_used_counter =
606
14
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
14
    _common_profile->add_info_string("IsColocate",
608
14
                                     std::to_string(_parent->is_colocated_operator()));
609
14
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
14
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
14
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
14
    return Status::OK();
613
14
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
864k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
864k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
864k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
864k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
864k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
864k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
864k
    _operator_profile->add_child(_common_profile.get(), true);
557
864k
    _operator_profile->add_child(_custom_profile.get(), true);
558
864k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
    if constexpr (!is_fake_shared) {
560
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
                                    .first.get()
563
                                    ->template cast<SharedStateArg>();
564
565
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
            _dependency = _shared_state->create_source_dependency(
576
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
        }
584
    }
585
586
864k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
864k
    _rows_returned_counter =
591
864k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
864k
    _blocks_returned_counter =
593
864k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
864k
    _output_block_bytes_counter =
595
864k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
864k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
864k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
864k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
864k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
864k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
864k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
864k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
864k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
864k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
864k
    _memory_used_counter =
606
864k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
864k
    _common_profile->add_info_string("IsColocate",
608
864k
                                     std::to_string(_parent->is_colocated_operator()));
609
864k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
864k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
864k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
864k
    return Status::OK();
613
864k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.6k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.6k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.6k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.6k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.6k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
54.6k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.6k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.6k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.6k
    if constexpr (!is_fake_shared) {
560
54.6k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
54.6k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
3.81k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
3.81k
            _dependency = _shared_state->create_source_dependency(
576
3.81k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
3.81k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
3.81k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
50.8k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
50.8k
        }
584
54.6k
    }
585
586
54.6k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
54.6k
    _rows_returned_counter =
591
54.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.6k
    _blocks_returned_counter =
593
54.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.6k
    _output_block_bytes_counter =
595
54.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.6k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.6k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.6k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.6k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.6k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.6k
    _memory_used_counter =
606
54.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.6k
    _common_profile->add_info_string("IsColocate",
608
54.6k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.6k
    return Status::OK();
613
54.6k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.40k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.40k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.40k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.40k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.40k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.40k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.40k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.40k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.40k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.40k
    if constexpr (!is_fake_shared) {
560
5.40k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.40k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
5.37k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.37k
            _dependency = _shared_state->create_source_dependency(
576
5.37k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.37k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.37k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.37k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
27
        }
584
5.40k
    }
585
586
5.40k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.40k
    _rows_returned_counter =
591
5.40k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.40k
    _blocks_returned_counter =
593
5.40k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.40k
    _output_block_bytes_counter =
595
5.40k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.40k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.40k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.40k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.40k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.40k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.40k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.40k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.40k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.40k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.40k
    _memory_used_counter =
606
5.40k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.40k
    _common_profile->add_info_string("IsColocate",
608
5.40k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.40k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.40k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.40k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.40k
    return Status::OK();
613
5.40k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
485
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
485
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
485
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
485
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
485
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
485
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
485
    _operator_profile->add_child(_common_profile.get(), true);
557
485
    _operator_profile->add_child(_custom_profile.get(), true);
558
485
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
485
    if constexpr (!is_fake_shared) {
560
485
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
485
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
481
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
481
            _dependency = _shared_state->create_source_dependency(
576
481
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
481
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
481
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
481
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
4
        }
584
485
    }
585
586
485
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
485
    _rows_returned_counter =
591
485
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
485
    _blocks_returned_counter =
593
485
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
485
    _output_block_bytes_counter =
595
485
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
485
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
485
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
485
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
485
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
485
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
485
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
485
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
485
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
485
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
485
    _memory_used_counter =
606
485
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
485
    _common_profile->add_info_string("IsColocate",
608
485
                                     std::to_string(_parent->is_colocated_operator()));
609
485
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
485
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
485
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
485
    return Status::OK();
613
485
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.19k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.19k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.19k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.19k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.19k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.19k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.19k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.19k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.19k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.19k
    if constexpr (!is_fake_shared) {
560
5.19k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.19k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.92k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.92k
            _dependency = _shared_state->create_source_dependency(
576
4.92k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.92k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.92k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.92k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
273
        }
584
5.19k
    }
585
586
5.19k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.19k
    _rows_returned_counter =
591
5.19k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.19k
    _blocks_returned_counter =
593
5.19k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.19k
    _output_block_bytes_counter =
595
5.19k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.19k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.19k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.19k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.19k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.19k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.19k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.19k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.19k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.19k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.19k
    _memory_used_counter =
606
5.19k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.19k
    _common_profile->add_info_string("IsColocate",
608
5.19k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.19k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.19k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.19k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.19k
    return Status::OK();
613
5.19k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
674k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
674k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
674k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
674k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
674k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
674k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
674k
    _operator_profile->add_child(_common_profile.get(), true);
557
674k
    _operator_profile->add_child(_custom_profile.get(), true);
558
674k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
674k
    if constexpr (!is_fake_shared) {
560
674k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
667k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
667k
                                    .first.get()
563
667k
                                    ->template cast<SharedStateArg>();
564
565
667k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
667k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
667k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
667k
        } else if (info.shared_state) {
569
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
7.02k
        } else {
580
7.02k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
7.02k
                DCHECK(false);
582
7.02k
            }
583
7.02k
        }
584
674k
    }
585
586
674k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
674k
    _rows_returned_counter =
591
674k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
674k
    _blocks_returned_counter =
593
674k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
674k
    _output_block_bytes_counter =
595
674k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
674k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
674k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
674k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
674k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
674k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
674k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
674k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
674k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
674k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
674k
    _memory_used_counter =
606
674k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
674k
    _common_profile->add_info_string("IsColocate",
608
674k
                                     std::to_string(_parent->is_colocated_operator()));
609
674k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
674k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
674k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
674k
    return Status::OK();
613
674k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
169
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
169
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
169
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
169
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
169
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
169
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
169
    _operator_profile->add_child(_common_profile.get(), true);
557
169
    _operator_profile->add_child(_custom_profile.get(), true);
558
169
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
169
    if constexpr (!is_fake_shared) {
560
169
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
169
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
169
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
169
            _dependency = _shared_state->create_source_dependency(
576
169
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
169
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
169
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
169
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
169
    }
585
586
169
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
169
    _rows_returned_counter =
591
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
169
    _blocks_returned_counter =
593
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
169
    _output_block_bytes_counter =
595
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
169
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
169
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
169
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
169
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
169
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
169
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
169
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
169
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
169
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
169
    _memory_used_counter =
606
169
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
169
    _common_profile->add_info_string("IsColocate",
608
169
                                     std::to_string(_parent->is_colocated_operator()));
609
169
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
169
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
169
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
169
    return Status::OK();
613
169
}
614
615
template <typename SharedStateArg>
616
2.08M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
2.08M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.39M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
302k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
302k
    }
621
2.08M
    if (_parent->has_projection()) {
622
385k
        const auto& projection = *_parent->_projection;
623
385k
        _projections.resize(projection.projections.size());
624
2.38M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.99M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.99M
        }
627
385k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
403k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
17.7k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
247k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
229k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
229k
                        state, _intermediate_projections[i][j]));
633
229k
            }
634
17.7k
        }
635
385k
    }
636
2.08M
    return Status::OK();
637
2.08M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
71.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
71.4k
    _conjuncts.resize(_parent->_conjuncts.size());
618
73.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.87k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.87k
    }
621
71.4k
    if (_parent->has_projection()) {
622
71.4k
        const auto& projection = *_parent->_projection;
623
71.4k
        _projections.resize(projection.projections.size());
624
384k
        for (size_t i = 0; i < _projections.size(); i++) {
625
313k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
313k
        }
627
71.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
79.1k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
7.79k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
185k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
177k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
177k
                        state, _intermediate_projections[i][j]));
633
177k
            }
634
7.79k
        }
635
71.4k
    }
636
71.4k
    return Status::OK();
637
71.4k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
3
    _conjuncts.resize(_parent->_conjuncts.size());
618
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
3
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
3
    return Status::OK();
637
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
207k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
207k
    _conjuncts.resize(_parent->_conjuncts.size());
618
207k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
207k
    if (_parent->has_projection()) {
622
80
        const auto& projection = *_parent->_projection;
623
80
        _projections.resize(projection.projections.size());
624
402
        for (size_t i = 0; i < _projections.size(); i++) {
625
322
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
322
        }
627
80
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
80
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
80
    }
636
207k
    return Status::OK();
637
207k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.86k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.86k
    _conjuncts.resize(_parent->_conjuncts.size());
618
7.03k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
165
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
165
    }
621
6.86k
    if (_parent->has_projection()) {
622
6.86k
        const auto& projection = *_parent->_projection;
623
6.86k
        _projections.resize(projection.projections.size());
624
29.1k
        for (size_t i = 0; i < _projections.size(); i++) {
625
22.2k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
22.2k
        }
627
6.86k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
6.91k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
52
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
377
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
325
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
325
                        state, _intermediate_projections[i][j]));
633
325
            }
634
52
        }
635
6.86k
    }
636
6.86k
    return Status::OK();
637
6.86k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.77k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.77k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.52k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
750
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
750
    }
621
8.77k
    if (_parent->has_projection()) {
622
4.49k
        const auto& projection = *_parent->_projection;
623
4.49k
        _projections.resize(projection.projections.size());
624
17.7k
        for (size_t i = 0; i < _projections.size(); i++) {
625
13.2k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
13.2k
        }
627
4.49k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.58k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
91
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
690
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
599
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
599
                        state, _intermediate_projections[i][j]));
633
599
            }
634
91
        }
635
4.49k
    }
636
8.77k
    return Status::OK();
637
8.77k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
94.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
94.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
96.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.39k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.39k
    }
621
94.6k
    if (_parent->has_projection()) {
622
30.8k
        const auto& projection = *_parent->_projection;
623
30.8k
        _projections.resize(projection.projections.size());
624
275k
        for (size_t i = 0; i < _projections.size(); i++) {
625
244k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
244k
        }
627
30.8k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
31.0k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
178
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
978
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
800
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
800
                        state, _intermediate_projections[i][j]));
633
800
            }
634
178
        }
635
30.8k
    }
636
94.6k
    return Status::OK();
637
94.6k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
84.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
84.2k
    _conjuncts.resize(_parent->_conjuncts.size());
618
84.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
15
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
15
    }
621
84.2k
    if (_parent->has_projection()) {
622
123
        const auto& projection = *_parent->_projection;
623
123
        _projections.resize(projection.projections.size());
624
410
        for (size_t i = 0; i < _projections.size(); i++) {
625
287
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
287
        }
627
123
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
126
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
14
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
11
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
11
                        state, _intermediate_projections[i][j]));
633
11
            }
634
3
        }
635
123
    }
636
84.2k
    return Status::OK();
637
84.2k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
18
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
18
    _conjuncts.resize(_parent->_conjuncts.size());
618
18
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
18
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
18
    return Status::OK();
637
18
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
870k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
870k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.16M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
298k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
298k
    }
621
870k
    if (_parent->has_projection()) {
622
260k
        const auto& projection = *_parent->_projection;
623
260k
        _projections.resize(projection.projections.size());
624
1.56M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.30M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.30M
        }
627
260k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
269k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
9.40k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
56.1k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
46.7k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
46.7k
                        state, _intermediate_projections[i][j]));
633
46.7k
            }
634
9.40k
        }
635
260k
    }
636
870k
    return Status::OK();
637
870k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
54.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
54.8k
    _conjuncts.resize(_parent->_conjuncts.size());
618
54.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
54.8k
    if (_parent->has_projection()) {
622
11.3k
        const auto& projection = *_parent->_projection;
623
11.3k
        _projections.resize(projection.projections.size());
624
109k
        for (size_t i = 0; i < _projections.size(); i++) {
625
98.5k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
98.5k
        }
627
11.3k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.5k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
179
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
4.09k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
3.91k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
3.91k
                        state, _intermediate_projections[i][j]));
633
3.91k
            }
634
179
        }
635
11.3k
    }
636
54.8k
    return Status::OK();
637
54.8k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.38k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.38k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.74k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
356
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
356
    }
621
5.38k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
5.38k
    return Status::OK();
637
5.38k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
486
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
486
    _conjuncts.resize(_parent->_conjuncts.size());
618
486
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
486
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
486
    return Status::OK();
637
486
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.25k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.25k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.25k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
5.25k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
228
        for (size_t i = 0; i < _projections.size(); i++) {
625
168
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
168
        }
627
60
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
60
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
60
    }
636
5.25k
    return Status::OK();
637
5.25k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
678k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
678k
    _conjuncts.resize(_parent->_conjuncts.size());
618
678k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
678k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
678k
    return Status::OK();
637
678k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
169
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
169
    _conjuncts.resize(_parent->_conjuncts.size());
618
176
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
169
    if (_parent->has_projection()) {
622
166
        const auto& projection = *_parent->_projection;
623
166
        _projections.resize(projection.projections.size());
624
491
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
627
166
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
169
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
8
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
8
                        state, _intermediate_projections[i][j]));
633
8
            }
634
3
        }
635
166
    }
636
169
    return Status::OK();
637
169
}
638
639
template <typename SharedStateArg>
640
6.44k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.44k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.44k
    _terminated = true;
645
6.44k
    return Status::OK();
646
6.44k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
328
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
328
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
328
    _terminated = true;
645
328
    return Status::OK();
646
328
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
31
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
31
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
31
    _terminated = true;
645
31
    return Status::OK();
646
31
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
25
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
25
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
25
    _terminated = true;
645
25
    return Status::OK();
646
25
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
46
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
46
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
46
    _terminated = true;
645
46
    return Status::OK();
646
46
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
4.57k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
4.57k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
4.57k
    _terminated = true;
645
4.57k
    return Status::OK();
646
4.57k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
31
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
31
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
31
    _terminated = true;
645
31
    return Status::OK();
646
31
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
3
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
3
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
3
    _terminated = true;
645
3
    return Status::OK();
646
3
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
336
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
336
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
336
    _terminated = true;
645
336
    return Status::OK();
646
336
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.03k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.03k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1.03k
    _terminated = true;
645
1.03k
    return Status::OK();
646
1.03k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
34
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
34
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
34
    _terminated = true;
645
34
    return Status::OK();
646
34
}
647
648
template <typename SharedStateArg>
649
2.32M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.32M
    if (_closed) {
651
237k
        return Status::OK();
652
237k
    }
653
2.08M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.21M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.21M
    }
656
2.08M
    _closed = true;
657
2.08M
    return Status::OK();
658
2.32M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
71.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
71.3k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
71.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
71.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
71.3k
    }
656
71.3k
    _closed = true;
657
71.3k
    return Status::OK();
658
71.3k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4
    }
656
4
    _closed = true;
657
4
    return Status::OK();
658
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
412k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
412k
    if (_closed) {
651
207k
        return Status::OK();
652
207k
    }
653
205k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
205k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
205k
    }
656
205k
    _closed = true;
657
205k
    return Status::OK();
658
412k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
25
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
25
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
25
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
25
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
25
    }
656
25
    _closed = true;
657
25
    return Status::OK();
658
25
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.85k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.85k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.85k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.85k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.85k
    }
656
6.85k
    _closed = true;
657
6.85k
    return Status::OK();
658
6.85k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
17.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
17.7k
    if (_closed) {
651
8.96k
        return Status::OK();
652
8.96k
    }
653
8.74k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.74k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.74k
    }
656
8.74k
    _closed = true;
657
8.74k
    return Status::OK();
658
17.7k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
94.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
94.5k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
94.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
94.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
94.5k
    }
656
94.5k
    _closed = true;
657
94.5k
    return Status::OK();
658
94.5k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
83.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
83.8k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
83.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
83.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
83.8k
    }
656
83.8k
    _closed = true;
657
83.8k
    return Status::OK();
658
83.8k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
13
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
13
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
13
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
13
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
13
    }
656
13
    _closed = true;
657
13
    return Status::OK();
658
13
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
886k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
886k
    if (_closed) {
651
15.4k
        return Status::OK();
652
15.4k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
870k
    _closed = true;
657
870k
    return Status::OK();
658
886k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
54.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
54.8k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
54.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
54.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
54.8k
    }
656
54.8k
    _closed = true;
657
54.8k
    return Status::OK();
658
54.8k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
14
    }
656
14
    _closed = true;
657
14
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.34k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.34k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.34k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.34k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.34k
    }
656
5.34k
    _closed = true;
657
5.34k
    return Status::OK();
658
5.34k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
766
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
766
    if (_closed) {
651
383
        return Status::OK();
652
383
    }
653
383
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
383
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
383
    }
656
383
    _closed = true;
657
383
    return Status::OK();
658
766
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.8k
    if (_closed) {
651
5.56k
        return Status::OK();
652
5.56k
    }
653
5.24k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.24k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.24k
    }
656
5.24k
    _closed = true;
657
5.24k
    return Status::OK();
658
10.8k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
679k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
679k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
679k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
679k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
679k
    }
656
679k
    _closed = true;
657
679k
    return Status::OK();
658
679k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
339
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
339
    if (_closed) {
651
179
        return Status::OK();
652
179
    }
653
160
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
160
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
160
    }
656
160
    _closed = true;
657
160
    return Status::OK();
658
339
}
659
660
template <typename SharedState>
661
1.75M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.75M
    _operator_profile =
664
1.75M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.75M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.75M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
1.75M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.75M
    _operator_profile->add_child(_common_profile, true);
673
1.75M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.75M
    _operator_profile->set_metadata(_parent->node_id());
676
1.75M
    _wait_for_finish_dependency_timer =
677
1.75M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.75M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.75M
    if constexpr (!is_fake_shared) {
680
1.25M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.25M
            info.shared_state_map.end()) {
682
369k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
269k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
269k
            }
685
369k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
369k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
369k
                                                  ? 0
688
369k
                                                  : info.task_idx]
689
369k
                                  .get();
690
369k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
883k
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
883k
            _shared_state = info.shared_state->template cast<SharedState>();
696
883k
            _dependency = _shared_state->create_sink_dependency(
697
883k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
883k
        }
699
1.25M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.25M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.25M
    }
702
703
1.75M
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
1.75M
    _rows_input_counter =
708
1.75M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.75M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.75M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.75M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.75M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.75M
    _memory_used_counter =
714
1.75M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.75M
    _common_profile->add_info_string("IsColocate",
716
1.75M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.75M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.75M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.75M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.75M
    return Status::OK();
721
1.75M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
119k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
119k
    _operator_profile =
664
119k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
119k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
119k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
119k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
119k
    _operator_profile->add_child(_common_profile, true);
673
119k
    _operator_profile->add_child(_custom_profile, true);
674
675
119k
    _operator_profile->set_metadata(_parent->node_id());
676
119k
    _wait_for_finish_dependency_timer =
677
119k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
119k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
119k
    if constexpr (!is_fake_shared) {
680
119k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
119k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
15.1k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
15.1k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
15.1k
                                                  ? 0
688
15.1k
                                                  : info.task_idx]
689
15.1k
                                  .get();
690
15.1k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
103k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
103k
            _shared_state = info.shared_state->template cast<SharedState>();
696
103k
            _dependency = _shared_state->create_sink_dependency(
697
103k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
103k
        }
699
119k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
119k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
119k
    }
702
703
119k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
119k
    _rows_input_counter =
708
119k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
119k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
119k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
119k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
119k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
119k
    _memory_used_counter =
714
119k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
119k
    _common_profile->add_info_string("IsColocate",
716
119k
                                     std::to_string(_parent->is_colocated_operator()));
717
119k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
119k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
119k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
119k
    return Status::OK();
721
119k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2
    _operator_profile =
664
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2
    _operator_profile->add_child(_common_profile, true);
673
2
    _operator_profile->add_child(_custom_profile, true);
674
675
2
    _operator_profile->set_metadata(_parent->node_id());
676
2
    _wait_for_finish_dependency_timer =
677
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2
    if constexpr (!is_fake_shared) {
680
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2
            _shared_state = info.shared_state->template cast<SharedState>();
696
2
            _dependency = _shared_state->create_sink_dependency(
697
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2
        }
699
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2
    }
702
703
2
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2
    _rows_input_counter =
708
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2
    _memory_used_counter =
714
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2
    _common_profile->add_info_string("IsColocate",
716
2
                                     std::to_string(_parent->is_colocated_operator()));
717
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2
    return Status::OK();
721
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
207k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
207k
    _operator_profile =
664
207k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
207k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
207k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
207k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
207k
    _operator_profile->add_child(_common_profile, true);
673
207k
    _operator_profile->add_child(_custom_profile, true);
674
675
207k
    _operator_profile->set_metadata(_parent->node_id());
676
207k
    _wait_for_finish_dependency_timer =
677
207k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
207k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
207k
    if constexpr (!is_fake_shared) {
680
207k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
207k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
207k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
207k
            _shared_state = info.shared_state->template cast<SharedState>();
696
207k
            _dependency = _shared_state->create_sink_dependency(
697
207k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
207k
        }
699
207k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
207k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
207k
    }
702
703
207k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
207k
    _rows_input_counter =
708
207k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
207k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
207k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
207k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
207k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
207k
    _memory_used_counter =
714
207k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
207k
    _common_profile->add_info_string("IsColocate",
716
207k
                                     std::to_string(_parent->is_colocated_operator()));
717
207k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
207k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
207k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
207k
    return Status::OK();
721
207k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
32
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
32
    _operator_profile =
664
32
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
32
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
32
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
32
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
32
    _operator_profile->add_child(_common_profile, true);
673
32
    _operator_profile->add_child(_custom_profile, true);
674
675
32
    _operator_profile->set_metadata(_parent->node_id());
676
32
    _wait_for_finish_dependency_timer =
677
32
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
32
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
32
    if constexpr (!is_fake_shared) {
680
32
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
32
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
32
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
32
            _shared_state = info.shared_state->template cast<SharedState>();
696
32
            _dependency = _shared_state->create_sink_dependency(
697
32
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
32
        }
699
32
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
32
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
32
    }
702
703
32
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
32
    _rows_input_counter =
708
32
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
32
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
32
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
32
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
32
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
32
    _memory_used_counter =
714
32
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
32
    _common_profile->add_info_string("IsColocate",
716
32
                                     std::to_string(_parent->is_colocated_operator()));
717
32
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
32
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
32
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
32
    return Status::OK();
721
32
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
6.83k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
6.83k
    _operator_profile =
664
6.83k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
6.83k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
6.83k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
6.83k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
6.83k
    _operator_profile->add_child(_common_profile, true);
673
6.83k
    _operator_profile->add_child(_custom_profile, true);
674
675
6.83k
    _operator_profile->set_metadata(_parent->node_id());
676
6.83k
    _wait_for_finish_dependency_timer =
677
6.83k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
6.83k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
6.83k
    if constexpr (!is_fake_shared) {
680
6.83k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
6.83k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
6.83k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
6.83k
            _shared_state = info.shared_state->template cast<SharedState>();
696
6.83k
            _dependency = _shared_state->create_sink_dependency(
697
6.83k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
6.83k
        }
699
6.83k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
6.83k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
6.83k
    }
702
703
6.83k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
6.83k
    _rows_input_counter =
708
6.83k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
6.83k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
6.83k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
6.83k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
6.83k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
6.83k
    _memory_used_counter =
714
6.83k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
6.83k
    _common_profile->add_info_string("IsColocate",
716
6.83k
                                     std::to_string(_parent->is_colocated_operator()));
717
6.83k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
6.83k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
6.83k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
6.83k
    return Status::OK();
721
6.83k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.76k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.76k
    _operator_profile =
664
8.76k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.76k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.76k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.76k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.76k
    _operator_profile->add_child(_common_profile, true);
673
8.76k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.76k
    _operator_profile->set_metadata(_parent->node_id());
676
8.76k
    _wait_for_finish_dependency_timer =
677
8.76k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.76k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.76k
    if constexpr (!is_fake_shared) {
680
8.76k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.76k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.76k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.76k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.76k
            _dependency = _shared_state->create_sink_dependency(
697
8.76k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.76k
        }
699
8.76k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.76k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.76k
    }
702
703
8.76k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.76k
    _rows_input_counter =
708
8.76k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.76k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.76k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.76k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.76k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.76k
    _memory_used_counter =
714
8.76k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.76k
    _common_profile->add_info_string("IsColocate",
716
8.76k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.76k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.76k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.76k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.76k
    return Status::OK();
721
8.76k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
94.4k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
94.4k
    _operator_profile =
664
94.4k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
94.4k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
94.4k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
94.4k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
94.4k
    _operator_profile->add_child(_common_profile, true);
673
94.4k
    _operator_profile->add_child(_custom_profile, true);
674
675
94.4k
    _operator_profile->set_metadata(_parent->node_id());
676
94.4k
    _wait_for_finish_dependency_timer =
677
94.4k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
94.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
94.4k
    if constexpr (!is_fake_shared) {
680
94.4k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
94.4k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
94.4k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
94.4k
            _shared_state = info.shared_state->template cast<SharedState>();
696
94.4k
            _dependency = _shared_state->create_sink_dependency(
697
94.4k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
94.4k
        }
699
94.4k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
94.4k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
94.4k
    }
702
703
94.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
94.4k
    _rows_input_counter =
708
94.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
94.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
94.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
94.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
94.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
94.4k
    _memory_used_counter =
714
94.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
94.4k
    _common_profile->add_info_string("IsColocate",
716
94.4k
                                     std::to_string(_parent->is_colocated_operator()));
717
94.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
94.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
94.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
94.4k
    return Status::OK();
721
94.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
84.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
84.0k
    _operator_profile =
664
84.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
84.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
84.0k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
84.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
84.0k
    _operator_profile->add_child(_common_profile, true);
673
84.0k
    _operator_profile->add_child(_custom_profile, true);
674
675
84.0k
    _operator_profile->set_metadata(_parent->node_id());
676
84.0k
    _wait_for_finish_dependency_timer =
677
84.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
84.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
84.0k
    if constexpr (!is_fake_shared) {
680
84.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
84.2k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
84.2k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
84.2k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
84.2k
                                                  ? 0
688
84.2k
                                                  : info.task_idx]
689
84.2k
                                  .get();
690
84.2k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
84.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
84.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
84.0k
    }
702
703
84.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
84.0k
    _rows_input_counter =
708
84.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
84.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
84.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
84.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
84.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
84.0k
    _memory_used_counter =
714
84.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
84.0k
    _common_profile->add_info_string("IsColocate",
716
84.0k
                                     std::to_string(_parent->is_colocated_operator()));
717
84.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
84.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
84.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
84.0k
    return Status::OK();
721
84.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
24
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
24
    _operator_profile =
664
24
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
24
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
24
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
24
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
24
    _operator_profile->add_child(_common_profile, true);
673
24
    _operator_profile->add_child(_custom_profile, true);
674
675
24
    _operator_profile->set_metadata(_parent->node_id());
676
24
    _wait_for_finish_dependency_timer =
677
24
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
24
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
24
    if constexpr (!is_fake_shared) {
680
24
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
24
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
24
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
24
            _shared_state = info.shared_state->template cast<SharedState>();
696
24
            _dependency = _shared_state->create_sink_dependency(
697
24
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
24
        }
699
24
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
24
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
24
    }
702
703
24
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
24
    _rows_input_counter =
708
24
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
24
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
24
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
24
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
24
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
24
    _memory_used_counter =
714
24
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
24
    _common_profile->add_info_string("IsColocate",
716
24
                                     std::to_string(_parent->is_colocated_operator()));
717
24
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
24
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
24
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
24
    return Status::OK();
721
24
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
500k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
500k
    _operator_profile =
664
500k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
500k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
500k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
500k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
500k
    _operator_profile->add_child(_common_profile, true);
673
500k
    _operator_profile->add_child(_custom_profile, true);
674
675
500k
    _operator_profile->set_metadata(_parent->node_id());
676
500k
    _wait_for_finish_dependency_timer =
677
500k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
500k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
    if constexpr (!is_fake_shared) {
680
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
                                                  ? 0
688
                                                  : info.task_idx]
689
                                  .get();
690
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
            _shared_state = info.shared_state->template cast<SharedState>();
696
            _dependency = _shared_state->create_sink_dependency(
697
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
        }
699
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
    }
702
703
500k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
500k
    _rows_input_counter =
708
500k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
500k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
500k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
500k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
500k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
500k
    _memory_used_counter =
714
500k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
500k
    _common_profile->add_info_string("IsColocate",
716
500k
                                     std::to_string(_parent->is_colocated_operator()));
717
500k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
500k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
500k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
500k
    return Status::OK();
721
500k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.89k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.89k
    _operator_profile =
664
8.89k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.89k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.89k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.89k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.89k
    _operator_profile->add_child(_common_profile, true);
673
8.89k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.89k
    _operator_profile->set_metadata(_parent->node_id());
676
8.89k
    _wait_for_finish_dependency_timer =
677
8.89k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.89k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.89k
    if constexpr (!is_fake_shared) {
680
8.89k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.89k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.89k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.89k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.89k
            _dependency = _shared_state->create_sink_dependency(
697
8.89k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.89k
        }
699
8.89k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.89k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.89k
    }
702
703
8.89k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.89k
    _rows_input_counter =
708
8.89k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.89k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.89k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.89k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.89k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.89k
    _memory_used_counter =
714
8.89k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.89k
    _common_profile->add_info_string("IsColocate",
716
8.89k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.89k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.89k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.89k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.89k
    return Status::OK();
721
8.89k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
483
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
483
    _operator_profile =
664
483
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
483
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
483
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
483
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
483
    _operator_profile->add_child(_common_profile, true);
673
483
    _operator_profile->add_child(_custom_profile, true);
674
675
483
    _operator_profile->set_metadata(_parent->node_id());
676
483
    _wait_for_finish_dependency_timer =
677
483
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
483
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
483
    if constexpr (!is_fake_shared) {
680
483
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
483
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
483
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
483
            _shared_state = info.shared_state->template cast<SharedState>();
696
483
            _dependency = _shared_state->create_sink_dependency(
697
483
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
483
        }
699
483
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
483
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
483
    }
702
703
485
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
483
    _rows_input_counter =
708
483
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
483
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
483
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
483
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
483
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
483
    _memory_used_counter =
714
483
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
483
    _common_profile->add_info_string("IsColocate",
716
483
                                     std::to_string(_parent->is_colocated_operator()));
717
483
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
483
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
483
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
483
    return Status::OK();
721
483
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.37k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.37k
    _operator_profile =
664
2.37k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.37k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.37k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2.37k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.37k
    _operator_profile->add_child(_common_profile, true);
673
2.37k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.37k
    _operator_profile->set_metadata(_parent->node_id());
676
2.37k
    _wait_for_finish_dependency_timer =
677
2.37k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.37k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.37k
    if constexpr (!is_fake_shared) {
680
2.37k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.37k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2.37k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.37k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.37k
            _dependency = _shared_state->create_sink_dependency(
697
2.37k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.37k
        }
699
2.37k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.37k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.37k
    }
702
703
2.37k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2.37k
    _rows_input_counter =
708
2.37k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.37k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.37k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.37k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.37k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.37k
    _memory_used_counter =
714
2.37k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.37k
    _common_profile->add_info_string("IsColocate",
716
2.37k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.37k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.37k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.37k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.37k
    return Status::OK();
721
2.37k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
12.7k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
12.7k
    _operator_profile =
664
12.7k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
12.7k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
12.7k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
12.7k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
12.7k
    _operator_profile->add_child(_common_profile, true);
673
12.7k
    _operator_profile->add_child(_custom_profile, true);
674
675
12.7k
    _operator_profile->set_metadata(_parent->node_id());
676
12.7k
    _wait_for_finish_dependency_timer =
677
12.7k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
12.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
12.7k
    if constexpr (!is_fake_shared) {
680
12.7k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
12.7k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
12.7k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
12.7k
            _shared_state = info.shared_state->template cast<SharedState>();
696
12.7k
            _dependency = _shared_state->create_sink_dependency(
697
12.7k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
12.7k
        }
699
12.7k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
12.7k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
12.7k
    }
702
703
12.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
12.7k
    _rows_input_counter =
708
12.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
12.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
12.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
12.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
12.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
12.7k
    _memory_used_counter =
714
12.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
12.7k
    _common_profile->add_info_string("IsColocate",
716
12.7k
                                     std::to_string(_parent->is_colocated_operator()));
717
12.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
12.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
12.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
12.7k
    return Status::OK();
721
12.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
269k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
269k
    _operator_profile =
664
269k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
269k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
269k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
269k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
269k
    _operator_profile->add_child(_common_profile, true);
673
269k
    _operator_profile->add_child(_custom_profile, true);
674
675
269k
    _operator_profile->set_metadata(_parent->node_id());
676
269k
    _wait_for_finish_dependency_timer =
677
269k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
269k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
269k
    if constexpr (!is_fake_shared) {
680
269k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
269k
            info.shared_state_map.end()) {
682
269k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
269k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
269k
            }
685
269k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
269k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
269k
                                                  ? 0
688
269k
                                                  : info.task_idx]
689
269k
                                  .get();
690
269k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
18.4E
                DCHECK(false);
694
18.4E
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
269k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
269k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
269k
    }
702
703
269k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
269k
    _rows_input_counter =
708
269k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
269k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
269k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
269k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
269k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
269k
    _memory_used_counter =
714
269k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
269k
    _common_profile->add_info_string("IsColocate",
716
269k
                                     std::to_string(_parent->is_colocated_operator()));
717
269k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
269k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
269k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
269k
    return Status::OK();
721
269k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
437k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
437k
    _operator_profile =
664
437k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
437k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
437k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
437k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
437k
    _operator_profile->add_child(_common_profile, true);
673
437k
    _operator_profile->add_child(_custom_profile, true);
674
675
437k
    _operator_profile->set_metadata(_parent->node_id());
676
437k
    _wait_for_finish_dependency_timer =
677
437k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
437k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
437k
    if constexpr (!is_fake_shared) {
680
437k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
437k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
437k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
437k
            _shared_state = info.shared_state->template cast<SharedState>();
696
437k
            _dependency = _shared_state->create_sink_dependency(
697
437k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
437k
        }
699
437k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
437k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
437k
    }
702
703
437k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
437k
    _rows_input_counter =
708
437k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
437k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
437k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
437k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
437k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
437k
    _memory_used_counter =
714
437k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
437k
    _common_profile->add_info_string("IsColocate",
716
437k
                                     std::to_string(_parent->is_colocated_operator()));
717
437k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
437k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
437k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
437k
    return Status::OK();
721
437k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
25
    _operator_profile =
664
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
25
    _operator_profile->add_child(_common_profile, true);
673
25
    _operator_profile->add_child(_custom_profile, true);
674
675
25
    _operator_profile->set_metadata(_parent->node_id());
676
25
    _wait_for_finish_dependency_timer =
677
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
25
    if constexpr (!is_fake_shared) {
680
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
25
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
25
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
25
            _shared_state = info.shared_state->template cast<SharedState>();
696
25
            _dependency = _shared_state->create_sink_dependency(
697
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
25
        }
699
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
25
    }
702
703
25
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
25
    _rows_input_counter =
708
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
25
    _memory_used_counter =
714
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
25
    _common_profile->add_info_string("IsColocate",
716
25
                                     std::to_string(_parent->is_colocated_operator()));
717
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
25
    return Status::OK();
721
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
338
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
338
    _operator_profile =
664
338
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
338
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
338
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
338
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
338
    _operator_profile->add_child(_common_profile, true);
673
338
    _operator_profile->add_child(_custom_profile, true);
674
675
338
    _operator_profile->set_metadata(_parent->node_id());
676
338
    _wait_for_finish_dependency_timer =
677
338
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
338
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
338
    if constexpr (!is_fake_shared) {
680
338
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
338
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
338
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
338
            _shared_state = info.shared_state->template cast<SharedState>();
696
338
            _dependency = _shared_state->create_sink_dependency(
697
338
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
338
        }
699
338
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
338
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
338
    }
702
703
338
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
338
    _rows_input_counter =
708
338
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
338
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
338
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
338
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
338
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
338
    _memory_used_counter =
714
338
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
338
    _common_profile->add_info_string("IsColocate",
716
338
                                     std::to_string(_parent->is_colocated_operator()));
717
338
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
338
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
338
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
338
    return Status::OK();
721
338
}
722
723
template <typename SharedState>
724
1.75M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.75M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.75M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.25M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.25M
    }
731
1.75M
    _closed = true;
732
1.75M
    return Status::OK();
733
1.75M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
119k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
119k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
119k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
119k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
119k
    }
731
119k
    _closed = true;
732
119k
    return Status::OK();
733
119k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1
    }
731
1
    _closed = true;
732
1
    return Status::OK();
733
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
206k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
206k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
206k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
206k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
206k
    }
731
206k
    _closed = true;
732
206k
    return Status::OK();
733
206k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
23
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
23
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
21
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
21
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
21
    }
731
21
    _closed = true;
732
21
    return Status::OK();
733
23
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
6.84k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
6.84k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
6.84k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
6.84k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
6.84k
    }
731
6.84k
    _closed = true;
732
6.84k
    return Status::OK();
733
6.84k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.71k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.71k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.71k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.71k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.71k
    }
731
8.71k
    _closed = true;
732
8.71k
    return Status::OK();
733
8.71k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
94.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
94.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
94.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
94.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
94.4k
    }
731
94.4k
    _closed = true;
732
94.4k
    return Status::OK();
733
94.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
83.9k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
83.9k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
83.9k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
83.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
83.9k
    }
731
83.9k
    _closed = true;
732
83.9k
    return Status::OK();
733
83.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
13
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
13
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
13
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
13
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
13
    }
731
13
    _closed = true;
732
13
    return Status::OK();
733
13
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
502k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
502k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
    }
731
502k
    _closed = true;
732
502k
    return Status::OK();
733
502k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.92k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.92k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.92k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.92k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.92k
    }
731
8.92k
    _closed = true;
732
8.92k
    return Status::OK();
733
8.92k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
383
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
383
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
383
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
383
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
383
    }
731
383
    _closed = true;
732
383
    return Status::OK();
733
383
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.37k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.37k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.37k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.37k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.37k
    }
731
2.37k
    _closed = true;
732
2.37k
    return Status::OK();
733
2.37k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
12.8k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
12.8k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
12.8k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
12.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
12.8k
    }
731
12.8k
    _closed = true;
732
12.8k
    return Status::OK();
733
12.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
271k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
271k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
271k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
271k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
271k
    }
731
271k
    _closed = true;
732
271k
    return Status::OK();
733
271k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
439k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
439k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
439k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
439k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
439k
    }
731
439k
    _closed = true;
732
439k
    return Status::OK();
733
439k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
14
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
14
    }
731
14
    _closed = true;
732
14
    return Status::OK();
733
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
338
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
338
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
338
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
338
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
338
    }
731
338
    _closed = true;
732
338
    return Status::OK();
733
338
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
4.29k
                                                          bool* eos) {
738
4.29k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.28k
    return pull(state, block, eos);
740
4.29k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
49
                                                          bool* eos) {
738
49
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
49
    return pull(state, block, eos);
740
49
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
4.24k
                                                          bool* eos) {
738
4.24k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
4.23k
    return pull(state, block, eos);
740
4.24k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
534k
                                                         bool* eos) {
745
534k
    auto& local_state = get_local_state(state);
746
534k
    if (need_more_input_data(state)) {
747
503k
        local_state._child_block->clear_column_data(
748
503k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
503k
                        .num_materialized_slots());
750
503k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
503k
                state, local_state._child_block.get(), &local_state._child_eos));
752
503k
        *eos = local_state._child_eos;
753
503k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
59.0k
            return Status::OK();
755
59.0k
        }
756
443k
        {
757
443k
            SCOPED_TIMER(local_state.exec_time_counter());
758
443k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
443k
        }
760
443k
    }
761
762
475k
    if (!need_more_input_data(state)) {
763
446k
        SCOPED_TIMER(local_state.exec_time_counter());
764
446k
        bool new_eos = false;
765
446k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
446k
        if (new_eos) {
767
372k
            *eos = true;
768
372k
        } else if (!need_more_input_data(state)) {
769
24.2k
            *eos = false;
770
24.2k
        }
771
446k
    }
772
475k
    return Status::OK();
773
475k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
138k
                                                         bool* eos) {
745
138k
    auto& local_state = get_local_state(state);
746
138k
    if (need_more_input_data(state)) {
747
119k
        local_state._child_block->clear_column_data(
748
119k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
119k
                        .num_materialized_slots());
750
119k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
119k
                state, local_state._child_block.get(), &local_state._child_eos));
752
119k
        *eos = local_state._child_eos;
753
119k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
36.8k
            return Status::OK();
755
36.8k
        }
756
82.6k
        {
757
82.6k
            SCOPED_TIMER(local_state.exec_time_counter());
758
82.6k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
82.6k
        }
760
82.6k
    }
761
762
101k
    if (!need_more_input_data(state)) {
763
101k
        SCOPED_TIMER(local_state.exec_time_counter());
764
101k
        bool new_eos = false;
765
101k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
101k
        if (new_eos) {
767
47.0k
            *eos = true;
768
54.8k
        } else if (!need_more_input_data(state)) {
769
11.2k
            *eos = false;
770
11.2k
        }
771
101k
    }
772
101k
    return Status::OK();
773
101k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.46k
                                                         bool* eos) {
745
4.46k
    auto& local_state = get_local_state(state);
746
4.46k
    if (need_more_input_data(state)) {
747
2.47k
        local_state._child_block->clear_column_data(
748
2.47k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.47k
                        .num_materialized_slots());
750
2.47k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.47k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.47k
        *eos = local_state._child_eos;
753
2.47k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
509
            return Status::OK();
755
509
        }
756
1.96k
        {
757
1.96k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.96k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.96k
        }
760
1.96k
    }
761
762
3.98k
    if (!need_more_input_data(state)) {
763
3.98k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.98k
        bool new_eos = false;
765
3.98k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.98k
        if (new_eos) {
767
1.37k
            *eos = true;
768
2.60k
        } else if (!need_more_input_data(state)) {
769
1.99k
            *eos = false;
770
1.99k
        }
771
3.98k
    }
772
3.95k
    return Status::OK();
773
3.95k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.88k
                                                         bool* eos) {
745
1.88k
    auto& local_state = get_local_state(state);
746
1.88k
    if (need_more_input_data(state)) {
747
1.88k
        local_state._child_block->clear_column_data(
748
1.88k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.88k
                        .num_materialized_slots());
750
1.88k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.88k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.88k
        *eos = local_state._child_eos;
753
1.88k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
769
            return Status::OK();
755
769
        }
756
1.11k
        {
757
1.11k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.11k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.11k
        }
760
1.11k
    }
761
762
1.11k
    if (!need_more_input_data(state)) {
763
1.11k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.11k
        bool new_eos = false;
765
1.11k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.11k
        if (new_eos) {
767
792
            *eos = true;
768
792
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.11k
    }
772
1.11k
    return Status::OK();
773
1.11k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
18.5k
                                                         bool* eos) {
745
18.5k
    auto& local_state = get_local_state(state);
746
18.5k
    if (need_more_input_data(state)) {
747
18.5k
        local_state._child_block->clear_column_data(
748
18.5k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
18.5k
                        .num_materialized_slots());
750
18.5k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
18.5k
                state, local_state._child_block.get(), &local_state._child_eos));
752
18.5k
        *eos = local_state._child_eos;
753
18.5k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
5.56k
            return Status::OK();
755
5.56k
        }
756
12.9k
        {
757
12.9k
            SCOPED_TIMER(local_state.exec_time_counter());
758
12.9k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
12.9k
        }
760
12.9k
    }
761
762
12.9k
    if (!need_more_input_data(state)) {
763
6.69k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.69k
        bool new_eos = false;
765
6.69k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.69k
        if (new_eos) {
767
6.61k
            *eos = true;
768
6.61k
        } else if (!need_more_input_data(state)) {
769
9
            *eos = false;
770
9
        }
771
6.69k
    }
772
12.9k
    return Status::OK();
773
12.9k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
342k
                                                         bool* eos) {
745
342k
    auto& local_state = get_local_state(state);
746
343k
    if (need_more_input_data(state)) {
747
343k
        local_state._child_block->clear_column_data(
748
343k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
343k
                        .num_materialized_slots());
750
343k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
343k
                state, local_state._child_block.get(), &local_state._child_eos));
752
343k
        *eos = local_state._child_eos;
753
343k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
13.9k
            return Status::OK();
755
13.9k
        }
756
329k
        {
757
329k
            SCOPED_TIMER(local_state.exec_time_counter());
758
329k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
329k
        }
760
329k
    }
761
762
328k
    if (!need_more_input_data(state)) {
763
306k
        SCOPED_TIMER(local_state.exec_time_counter());
764
306k
        bool new_eos = false;
765
306k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
306k
        if (new_eos) {
767
305k
            *eos = true;
768
305k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
306k
    }
772
328k
    return Status::OK();
773
328k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
21.5k
                                                         bool* eos) {
745
21.5k
    auto& local_state = get_local_state(state);
746
21.5k
    if (need_more_input_data(state)) {
747
10.8k
        local_state._child_block->clear_column_data(
748
10.8k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
10.8k
                        .num_materialized_slots());
750
10.8k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
10.8k
                state, local_state._child_block.get(), &local_state._child_eos));
752
10.8k
        *eos = local_state._child_eos;
753
10.8k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
556
            return Status::OK();
755
556
        }
756
10.2k
        {
757
10.2k
            SCOPED_TIMER(local_state.exec_time_counter());
758
10.2k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
10.2k
        }
760
10.2k
    }
761
762
20.9k
    if (!need_more_input_data(state)) {
763
20.3k
        SCOPED_TIMER(local_state.exec_time_counter());
764
20.3k
        bool new_eos = false;
765
20.3k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
20.3k
        if (new_eos) {
767
6.77k
            *eos = true;
768
13.5k
        } else if (!need_more_input_data(state)) {
769
10.6k
            *eos = false;
770
10.6k
        }
771
20.3k
    }
772
20.9k
    return Status::OK();
773
20.9k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
6.94k
                                                         bool* eos) {
745
6.94k
    auto& local_state = get_local_state(state);
746
6.94k
    if (need_more_input_data(state)) {
747
6.57k
        local_state._child_block->clear_column_data(
748
6.57k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
6.57k
                        .num_materialized_slots());
750
6.57k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
6.57k
                state, local_state._child_block.get(), &local_state._child_eos));
752
6.57k
        *eos = local_state._child_eos;
753
6.57k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
822
            return Status::OK();
755
822
        }
756
5.75k
        {
757
5.75k
            SCOPED_TIMER(local_state.exec_time_counter());
758
5.75k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
5.75k
        }
760
5.75k
    }
761
762
6.12k
    if (!need_more_input_data(state)) {
763
6.12k
        SCOPED_TIMER(local_state.exec_time_counter());
764
6.12k
        bool new_eos = false;
765
6.12k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
6.12k
        if (new_eos) {
767
4.10k
            *eos = true;
768
4.10k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
6.12k
    }
772
6.11k
    return Status::OK();
773
6.11k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
48.0k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
48.0k
    RETURN_IF_ERROR(Base::init(state, info));
779
48.0k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
48.0k
                                                         "AsyncWriterDependency", true);
781
48.0k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
48.0k
                             _finish_dependency));
783
784
48.0k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
48.0k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
48.0k
    return Status::OK();
787
48.0k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
346
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
346
    RETURN_IF_ERROR(Base::init(state, info));
779
346
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
346
                                                         "AsyncWriterDependency", true);
781
346
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
346
                             _finish_dependency));
783
784
346
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
346
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
346
    return Status::OK();
787
346
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
47.6k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
47.6k
    RETURN_IF_ERROR(Base::init(state, info));
779
47.6k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
47.6k
                                                         "AsyncWriterDependency", true);
781
47.6k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
47.6k
                             _finish_dependency));
783
784
47.6k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
47.6k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
47.6k
    return Status::OK();
787
47.6k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
48.6k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
48.6k
    RETURN_IF_ERROR(Base::open(state));
793
48.6k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
379k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
330k
        RETURN_IF_ERROR(
796
330k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
330k
    }
798
48.6k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
48.6k
    return Status::OK();
800
48.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
349
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
349
    RETURN_IF_ERROR(Base::open(state));
793
349
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.82k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.47k
        RETURN_IF_ERROR(
796
1.47k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.47k
    }
798
349
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
349
    return Status::OK();
800
349
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
48.2k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
48.2k
    RETURN_IF_ERROR(Base::open(state));
793
48.2k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
377k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
329k
        RETURN_IF_ERROR(
796
329k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
329k
    }
798
48.2k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
48.2k
    return Status::OK();
800
48.2k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
63.8k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
63.8k
    return _writer->sink(block, eos);
806
63.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.42k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.42k
    return _writer->sink(block, eos);
806
1.42k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
62.4k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
62.4k
    return _writer->sink(block, eos);
806
62.4k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
48.6k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
48.6k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
48.6k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
48.6k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
48.7k
    if (_writer) {
818
48.7k
        Status st = _writer->get_writer_status();
819
48.7k
        if (exec_status.ok()) {
820
48.6k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
48.6k
                                                       : Status::Cancelled("force close"));
822
48.6k
        } else {
823
135
            _writer->force_close(exec_status);
824
135
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
48.7k
        RETURN_IF_ERROR(st);
829
48.7k
    }
830
48.6k
    return Base::close(state, exec_status);
831
48.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
337
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
337
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
337
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
337
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
337
    if (_writer) {
818
337
        Status st = _writer->get_writer_status();
819
337
        if (exec_status.ok()) {
820
337
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
337
                                                       : Status::Cancelled("force close"));
822
337
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
337
        RETURN_IF_ERROR(st);
829
337
    }
830
337
    return Base::close(state, exec_status);
831
337
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
48.3k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
48.3k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
48.3k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
48.3k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
48.4k
    if (_writer) {
818
48.4k
        Status st = _writer->get_writer_status();
819
48.4k
        if (exec_status.ok()) {
820
48.2k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
48.2k
                                                       : Status::Cancelled("force close"));
822
48.2k
        } else {
823
135
            _writer->force_close(exec_status);
824
135
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
48.4k
        RETURN_IF_ERROR(st);
829
48.4k
    }
830
48.2k
    return Base::close(state, exec_status);
831
48.3k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
832
833
// An instantiation added outside the macros below needs the matching
834
// 'extern template' declaration in the operator's header (enforced by
835
// build-support/check-extern-template-pairing.py). Instantiations expanded
836
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
837
// skipped -- so their extern pairing has to be kept in sync by hand.
838
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
839
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
840
DECLARE_OPERATOR(ResultSinkLocalState)
841
DECLARE_OPERATOR(JdbcTableSinkLocalState)
842
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
843
DECLARE_OPERATOR(ResultFileSinkLocalState)
844
DECLARE_OPERATOR(OlapTableSinkLocalState)
845
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
846
DECLARE_OPERATOR(HiveTableSinkLocalState)
847
DECLARE_OPERATOR(TVFTableSinkLocalState)
848
DECLARE_OPERATOR(IcebergTableSinkLocalState)
849
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
850
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
851
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
852
DECLARE_OPERATOR(MCTableSinkLocalState)
853
DECLARE_OPERATOR(AnalyticSinkLocalState)
854
DECLARE_OPERATOR(BlackholeSinkLocalState)
855
DECLARE_OPERATOR(SortSinkLocalState)
856
DECLARE_OPERATOR(SpillSortSinkLocalState)
857
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
858
DECLARE_OPERATOR(AggSinkLocalState)
859
DECLARE_OPERATOR(BucketedAggSinkLocalState)
860
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
861
DECLARE_OPERATOR(ExchangeSinkLocalState)
862
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
863
DECLARE_OPERATOR(UnionSinkLocalState)
864
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
865
DECLARE_OPERATOR(PartitionSortSinkLocalState)
866
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
867
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
868
DECLARE_OPERATOR(SetSinkLocalState<true>)
869
DECLARE_OPERATOR(SetSinkLocalState<false>)
870
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
871
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
872
DECLARE_OPERATOR(CacheSinkLocalState)
873
DECLARE_OPERATOR(DictSinkLocalState)
874
DECLARE_OPERATOR(RecCTESinkLocalState)
875
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
876
877
#undef DECLARE_OPERATOR
878
879
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
880
DECLARE_OPERATOR(HashJoinProbeLocalState)
881
DECLARE_OPERATOR(OlapScanLocalState)
882
DECLARE_OPERATOR(GroupCommitLocalState)
883
DECLARE_OPERATOR(JDBCScanLocalState)
884
DECLARE_OPERATOR(FileScanLocalState)
885
DECLARE_OPERATOR(AnalyticLocalState)
886
DECLARE_OPERATOR(SortLocalState)
887
DECLARE_OPERATOR(SpillSortLocalState)
888
DECLARE_OPERATOR(LocalMergeSortLocalState)
889
DECLARE_OPERATOR(AggLocalState)
890
DECLARE_OPERATOR(BucketedAggLocalState)
891
DECLARE_OPERATOR(PartitionedAggLocalState)
892
DECLARE_OPERATOR(TableFunctionLocalState)
893
DECLARE_OPERATOR(ExchangeLocalState)
894
DECLARE_OPERATOR(RepeatLocalState)
895
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
896
DECLARE_OPERATOR(AssertNumRowsLocalState)
897
DECLARE_OPERATOR(EmptySetLocalState)
898
DECLARE_OPERATOR(UnionSourceLocalState)
899
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
900
DECLARE_OPERATOR(PartitionSortSourceLocalState)
901
DECLARE_OPERATOR(SetSourceLocalState<true>)
902
DECLARE_OPERATOR(SetSourceLocalState<false>)
903
DECLARE_OPERATOR(DataGenLocalState)
904
DECLARE_OPERATOR(SchemaScanLocalState)
905
DECLARE_OPERATOR(MetaScanLocalState)
906
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
907
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
908
DECLARE_OPERATOR(CacheSourceLocalState)
909
DECLARE_OPERATOR(RecCTESourceLocalState)
910
DECLARE_OPERATOR(RecCTEScanLocalState)
911
912
#ifdef BE_TEST
913
DECLARE_OPERATOR(MockLocalState)
914
DECLARE_OPERATOR(MockScanLocalState)
915
#endif
916
#undef DECLARE_OPERATOR
917
918
template class StreamingOperatorX<AssertNumRowsLocalState>;
919
template class StreamingOperatorX<SelectLocalState>;
920
921
template class StatefulOperatorX<HashJoinProbeLocalState>;
922
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
923
template class StatefulOperatorX<RepeatLocalState>;
924
template class StatefulOperatorX<MaterializationLocalState>;
925
template class StatefulOperatorX<StreamingAggLocalState>;
926
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
927
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
928
template class StatefulOperatorX<TableFunctionLocalState>;
929
930
template class PipelineXSinkLocalState<HashJoinSharedState>;
931
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
932
template class PipelineXSinkLocalState<SortSharedState>;
933
template class PipelineXSinkLocalState<SpillSortSharedState>;
934
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
935
template class PipelineXSinkLocalState<AnalyticSharedState>;
936
template class PipelineXSinkLocalState<AggSharedState>;
937
template class PipelineXSinkLocalState<BucketedAggSharedState>;
938
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
939
template class PipelineXSinkLocalState<FakeSharedState>;
940
template class PipelineXSinkLocalState<UnionSharedState>;
941
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
942
template class PipelineXSinkLocalState<MultiCastSharedState>;
943
template class PipelineXSinkLocalState<SetSharedState>;
944
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
945
template class PipelineXSinkLocalState<BasicSharedState>;
946
template class PipelineXSinkLocalState<DataQueueSharedState>;
947
template class PipelineXSinkLocalState<RecCTESharedState>;
948
949
template class PipelineXLocalState<HashJoinSharedState>;
950
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
951
template class PipelineXLocalState<SortSharedState>;
952
template class PipelineXLocalState<SpillSortSharedState>;
953
template class PipelineXLocalState<NestedLoopJoinSharedState>;
954
template class PipelineXLocalState<AnalyticSharedState>;
955
template class PipelineXLocalState<AggSharedState>;
956
template class PipelineXLocalState<BucketedAggSharedState>;
957
template class PipelineXLocalState<PartitionedAggSharedState>;
958
template class PipelineXLocalState<FakeSharedState>;
959
template class PipelineXLocalState<UnionSharedState>;
960
template class PipelineXLocalState<DataQueueSharedState>;
961
template class PipelineXLocalState<MultiCastSharedState>;
962
template class PipelineXLocalState<PartitionSortNodeSharedState>;
963
template class PipelineXLocalState<SetSharedState>;
964
template class PipelineXLocalState<LocalExchangeSharedState>;
965
template class PipelineXLocalState<BasicSharedState>;
966
template class PipelineXLocalState<RecCTESharedState>;
967
968
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
969
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
970
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
971
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
972
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
973
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
974
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
975
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
976
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
977
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
978
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
979
980
#ifdef BE_TEST
981
template class OperatorX<DummyOperatorLocalState>;
982
template class DataSinkOperatorX<DummySinkLocalState>;
983
#endif
984
985
} // namespace doris