Coverage Report

Created: 2026-08-06 18:50

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
2.47M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
2.47M
    if (_parent->nereids_id() == -1) {
122
1.33M
        return fmt::format("(id={})", _parent->node_id());
123
1.33M
    } else {
124
1.13M
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
1.13M
    }
126
2.47M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
73.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
73.4k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
73.4k
    } else {
124
73.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
73.4k
    }
126
73.4k
}
_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
271k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
271k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
271k
    } else {
124
271k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
271k
    }
126
271k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
24
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
24
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
24
    } else {
124
24
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
24
    }
126
24
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
11.2k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
11.2k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
11.2k
    } else {
124
11.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
11.2k
    }
126
11.2k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
10.0k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
10.0k
    if (_parent->nereids_id() == -1) {
122
11
        return fmt::format("(id={})", _parent->node_id());
123
9.99k
    } else {
124
9.99k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
9.99k
    }
126
10.0k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
162k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
162k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
162k
    } else {
124
162k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
162k
    }
126
162k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
557
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
557
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
557
    } else {
124
557
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
557
    }
126
557
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
28
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
28
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
28
    } else {
124
28
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
28
    }
126
28
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
978k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
978k
    if (_parent->nereids_id() == -1) {
122
430k
        return fmt::format("(id={})", _parent->node_id());
123
547k
    } else {
124
547k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
547k
    }
126
978k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
56.7k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
56.7k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
56.7k
    } else {
124
56.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
56.7k
    }
126
56.7k
}
_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
10.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
10.4k
    if (_parent->nereids_id() == -1) {
122
10.4k
        return fmt::format("(id={})", _parent->node_id());
123
10.4k
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
10.4k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
720
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
720
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
618
    } else {
124
618
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
618
    }
126
720
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.02k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.02k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.01k
    } else {
124
5.01k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.01k
    }
126
5.02k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
892k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
893k
    if (_parent->nereids_id() == -1) {
122
893k
        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
892k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
164
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
164
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
164
    } else {
124
164
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
164
    }
126
164
}
127
128
template <typename SharedStateArg>
129
1.52M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.52M
    if (_parent->nereids_id() == -1) {
131
931k
        return fmt::format("(id={})", _parent->node_id());
132
931k
    } else {
133
590k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
590k
    }
135
1.52M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
122k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
122k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
122k
    } else {
133
122k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
122k
    }
135
122k
}
_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
273k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
273k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
273k
    } else {
133
273k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
273k
    }
135
273k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
31
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
31
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
31
    } else {
133
31
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
31
    }
135
31
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
11.3k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
11.3k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
11.3k
    } else {
133
11.3k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
11.3k
    }
135
11.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
10.0k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
10.0k
    if (_parent->nereids_id() == -1) {
131
11
        return fmt::format("(id={})", _parent->node_id());
132
10.0k
    } else {
133
10.0k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
10.0k
    }
135
10.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
163k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
163k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
162k
    } else {
133
162k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
162k
    }
135
163k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
556
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
556
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
556
    } else {
133
556
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
556
    }
135
556
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
38
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
38
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
38
    } else {
133
38
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
38
    }
135
38
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
131
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
131
    if (_parent->nereids_id() == -1) {
131
131
        return fmt::format("(id={})", _parent->node_id());
132
131
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
131
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
7.71k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
7.71k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
7.71k
    } else {
133
7.71k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
7.71k
    }
135
7.71k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
726
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
726
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
624
    } else {
133
624
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
624
    }
135
726
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.8k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
12.8k
    if (_parent->nereids_id() == -1) {
131
12.7k
        return fmt::format("(id={})", _parent->node_id());
132
12.7k
    } else {
133
40
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
40
    }
135
12.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
359k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
359k
    if (_parent->nereids_id() == -1) {
131
359k
        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
359k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
559k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
559k
    if (_parent->nereids_id() == -1) {
131
558k
        return fmt::format("(id={})", _parent->node_id());
132
558k
    } else {
133
1.01k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
1.01k
    }
135
559k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
25
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
25
    if (_parent->nereids_id() == -1) {
131
25
        return fmt::format("(id={})", _parent->node_id());
132
25
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
328
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
328
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
328
    } else {
133
328
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
328
    }
135
328
}
136
137
template <typename SharedStateArg>
138
30.3k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
30.3k
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
30.3k
    _terminated = true;
143
30.3k
    return Status::OK();
144
30.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
24.0k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
24.0k
    _terminated = true;
143
24.0k
    return Status::OK();
144
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.14k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.14k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.14k
    _terminated = true;
143
1.14k
    return Status::OK();
144
1.14k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3
    _terminated = true;
143
3
    return Status::OK();
144
3
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2
    _terminated = true;
143
2
    return Status::OK();
144
2
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3.31k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3.31k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3.31k
    _terminated = true;
143
3.31k
    return Status::OK();
144
3.31k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
16
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
16
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
16
    _terminated = true;
143
16
    return Status::OK();
144
16
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
571
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
571
    if (_terminated) {
140
1
        return Status::OK();
141
1
    }
142
570
    _terminated = true;
143
570
    return Status::OK();
144
571
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
53
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
53
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
53
    _terminated = true;
143
53
    return Status::OK();
144
53
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2
    _terminated = true;
143
2
    return Status::OK();
144
2
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
957
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
957
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
957
    _terminated = true;
143
957
    return Status::OK();
144
957
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
6
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
6
    _terminated = true;
143
6
    return Status::OK();
144
6
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
142
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
142
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
142
    _terminated = true;
143
142
    return Status::OK();
144
142
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
133
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
133
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
133
    _terminated = true;
143
133
    return Status::OK();
144
133
}
145
146
439k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
439k
    return _child && _child->is_serial_operator() && !is_source()
148
439k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
439k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
439k
}
151
152
37.8k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
37.8k
    if (!_child) {
154
33.0k
        return false;
155
33.0k
    }
156
4.79k
    if (_child->is_serial_operator()) {
157
79
        return true;
158
79
    }
159
4.71k
    const auto child_distribution = _child->required_data_distribution(state);
160
4.71k
    return child_distribution.need_local_exchange() &&
161
4.71k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
4.79k
}
163
164
82.8k
const RowDescriptor& OperatorBase::row_desc() const {
165
82.8k
    return _child->row_desc();
166
82.8k
}
167
168
template <typename SharedStateArg>
169
19.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
19.6k
    fmt::memory_buffer debug_string_buffer;
171
19.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
19.6k
    return fmt::to_string(debug_string_buffer);
173
19.6k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
3
    fmt::memory_buffer debug_string_buffer;
171
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
3
    return fmt::to_string(debug_string_buffer);
173
3
}
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
169
19.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
19.6k
    fmt::memory_buffer debug_string_buffer;
171
19.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
19.6k
    return fmt::to_string(debug_string_buffer);
173
19.6k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
169
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
1
    fmt::memory_buffer debug_string_buffer;
171
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
1
    return fmt::to_string(debug_string_buffer);
173
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
174
175
template <typename SharedStateArg>
176
19.6k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
19.6k
    fmt::memory_buffer debug_string_buffer;
178
19.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
19.6k
    return fmt::to_string(debug_string_buffer);
180
19.6k
}
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
176
19.6k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
19.6k
    fmt::memory_buffer debug_string_buffer;
178
19.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
19.6k
    return fmt::to_string(debug_string_buffer);
180
19.6k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
181
182
19.7k
std::string OperatorXBase::debug_string(int indentation_level) const {
183
19.7k
    fmt::memory_buffer debug_string_buffer;
184
19.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
185
19.7k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
186
19.7k
                   _is_serial_operator);
187
19.7k
    return fmt::to_string(debug_string_buffer);
188
19.7k
}
189
190
19.6k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
191
19.6k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
192
19.6k
}
193
194
857k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
195
857k
    std::string node_name = print_plan_node_type(tnode.node_type);
196
857k
    _nereids_id = tnode.nereids_id;
197
857k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
198
4.12k
        if (!tnode.__isset.output_tuple_id) {
199
0
            return Status::InternalError("no final output tuple id");
200
0
        }
201
4.12k
        if (tnode.intermediate_output_tuple_id_list.size() !=
202
4.12k
            tnode.intermediate_projections_list.size()) {
203
0
            return Status::InternalError(
204
0
                    "intermediate_output_tuple_id_list size:{} not match "
205
0
                    "intermediate_projections_list size:{}",
206
0
                    tnode.intermediate_output_tuple_id_list.size(),
207
0
                    tnode.intermediate_projections_list.size());
208
0
        }
209
4.12k
    }
210
857k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
211
857k
    _op_name = substr + "_OPERATOR";
212
213
857k
    if (tnode.__isset.vconjunct) {
214
0
        return Status::InternalError("vconjunct is not supported yet");
215
857k
    } else if (tnode.__isset.conjuncts) {
216
488k
        for (const auto& conjunct : tnode.conjuncts) {
217
488k
            VExprContextSPtr context;
218
488k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
219
488k
            _conjuncts.emplace_back(context);
220
488k
        }
221
157k
    }
222
223
    // create the projections expr
224
857k
    if (tnode.__isset.projections) {
225
332k
        DCHECK(tnode.__isset.output_tuple_id);
226
332k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projections));
227
332k
    }
228
857k
    if (!tnode.intermediate_projections_list.empty()) {
229
4.12k
        DCHECK(tnode.__isset.projections) << "no final projections";
230
4.12k
        _intermediate_projections.reserve(tnode.intermediate_projections_list.size());
231
8.35k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
232
8.35k
            VExprContextSPtrs projections;
233
8.35k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
234
8.35k
            _intermediate_projections.push_back(projections);
235
8.35k
        }
236
4.12k
    }
237
857k
    return Status::OK();
238
857k
}
239
240
891k
Status OperatorXBase::prepare(RuntimeState* state) {
241
891k
    for (auto& conjunct : _conjuncts) {
242
487k
        RETURN_IF_ERROR(conjunct->prepare(state, intermediate_row_desc()));
243
487k
    }
244
891k
    if (state->enable_adjust_conjunct_order_by_cost()) {
245
839k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
246
648k
            return a->execute_cost() < b->execute_cost();
247
648k
        });
248
839k
    };
249
250
899k
    for (int i = 0; i < _intermediate_projections.size(); i++) {
251
8.35k
        RETURN_IF_ERROR(
252
8.35k
                VExpr::prepare(_intermediate_projections[i], state, intermediate_row_desc(i)));
253
8.35k
    }
254
891k
    RETURN_IF_ERROR(VExpr::prepare(_projections, state, projections_row_desc()));
255
256
891k
    if (has_output_row_desc()) {
257
332k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(_projections, *_output_row_descriptor));
258
332k
    }
259
260
891k
    for (auto& conjunct : _conjuncts) {
261
488k
        RETURN_IF_ERROR(conjunct->open(state));
262
488k
    }
263
891k
    RETURN_IF_ERROR(VExpr::open(_projections, state));
264
891k
    for (auto& projections : _intermediate_projections) {
265
8.35k
        RETURN_IF_ERROR(VExpr::open(projections, state));
266
8.35k
    }
267
891k
    if (_child && !is_source()) {
268
135k
        RETURN_IF_ERROR(_child->prepare(state));
269
135k
    }
270
271
891k
    if (VExpr::contains_blockable_function(_conjuncts) ||
272
893k
        VExpr::contains_blockable_function(_projections)) {
273
0
        _blockable = true;
274
0
    }
275
276
891k
    return Status::OK();
277
891k
}
278
279
7.86k
Status OperatorXBase::terminate(RuntimeState* state) {
280
7.86k
    if (_child && !is_source()) {
281
1.47k
        RETURN_IF_ERROR(_child->terminate(state));
282
1.47k
    }
283
7.86k
    auto result = state->get_local_state_result(operator_id());
284
7.86k
    if (!result) {
285
0
        return result.error();
286
0
    }
287
7.86k
    return result.value()->terminate(state);
288
7.86k
}
289
290
6.87M
Status OperatorXBase::close(RuntimeState* state) {
291
6.87M
    if (_child && !is_source()) {
292
1.25M
        RETURN_IF_ERROR(_child->close(state));
293
1.25M
    }
294
6.87M
    auto result = state->get_local_state_result(operator_id());
295
6.87M
    if (!result) {
296
0
        return result.error();
297
0
    }
298
6.87M
    return result.value()->close(state);
299
6.87M
}
300
301
298k
void PipelineXLocalStateBase::clear_origin_block() {
302
298k
    _origin_block.clear_column_data(_parent->intermediate_row_desc().num_materialized_slots());
303
298k
}
304
305
705k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
306
705k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
307
308
705k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
309
705k
    return Status::OK();
310
705k
}
311
312
0
bool PipelineXLocalStateBase::is_blockable() const {
313
0
    return std::any_of(_projections.begin(), _projections.end(),
314
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
315
0
}
316
317
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
318
298k
                                     Block* output_block) const {
319
298k
    auto* local_state = state->get_local_state(operator_id());
320
298k
    SCOPED_TIMER(local_state->exec_time_counter());
321
298k
    SCOPED_TIMER(local_state->_projection_timer);
322
298k
    const size_t rows = origin_block->rows();
323
298k
    if (rows == 0) {
324
156k
        return Status::OK();
325
156k
    }
326
142k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
327
328
142k
    {
329
142k
        Block input_block = *origin_block;
330
331
142k
        ColumnsWithTypeAndName new_columns;
332
142k
        for (const auto& projections : local_state->_intermediate_projections) {
333
1.89k
            if (projections.empty()) {
334
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
335
0
                                             node_id());
336
0
            }
337
1.89k
            new_columns.resize(projections.size());
338
14.8k
            for (int i = 0; i < projections.size(); i++) {
339
13.0k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
340
13.0k
                if (new_columns[i].column->size() != rows) {
341
0
                    return Status::InternalError(
342
0
                            "intermediate projection result column size {} not equal input rows "
343
0
                            "{}, expr: {}",
344
0
                            new_columns[i].column->size(), rows,
345
0
                            projections[i]->root()->debug_string());
346
0
                }
347
13.0k
            }
348
1.89k
            Block tmp_block {new_columns};
349
1.89k
            input_block.swap(tmp_block);
350
1.89k
        }
351
352
142k
        if (input_block.rows() != rows) {
353
0
            return Status::InternalError(
354
0
                    "after intermediate projections input block rows {} not equal origin rows {}, "
355
0
                    "input_block: {}",
356
0
                    input_block.rows(), rows, input_block.dump_structure());
357
0
        }
358
359
142k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
360
142k
                output_block, *_output_row_descriptor);
361
142k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
362
142k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
363
142k
        Columns shared_columns(mutable_columns.size());
364
365
818k
        for (int i = 0; i < mutable_columns.size(); ++i) {
366
675k
            ColumnPtr column_ptr;
367
675k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
368
675k
            if (column_ptr->size() != rows) {
369
0
                return Status::InternalError(
370
0
                        "projection result column size {} not equal input rows {}, expr: {}",
371
0
                        column_ptr->size(), rows,
372
0
                        local_state->_projections[i]->root()->debug_string());
373
0
            }
374
675k
            column_ptr = column_ptr->convert_to_full_column_if_const();
375
675k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
376
0
                column_ptr = make_nullable(column_ptr, false);
377
0
            }
378
675k
            if (column_ptr->is_exclusive()) {
379
248k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
380
427k
            } else {
381
427k
                shared_columns[i] = std::move(column_ptr);
382
427k
            }
383
675k
        }
384
385
142k
        scoped_mutable_block.restore();
386
818k
        for (int i = 0; i < shared_columns.size(); ++i) {
387
675k
            if (shared_columns[i]) {
388
427k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
389
427k
            }
390
675k
        }
391
142k
    }
392
393
0
    origin_block->clear_column_data(
394
142k
            local_state->_parent->intermediate_row_desc().num_materialized_slots());
395
142k
    DCHECK_EQ(output_block->rows(), rows);
396
397
142k
    return Status::OK();
398
142k
}
399
400
5.10M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
401
5.10M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
402
5.10M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
403
5.10M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
404
5.10M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
405
5.10M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
406
5.10M
            if (_debug_point_count++ % 2 == 0) {
407
5.10M
                return Status::OK();
408
5.10M
            }
409
5.10M
        }
410
5.10M
    });
411
412
5.10M
    Status status;
413
5.10M
    auto* local_state = state->get_local_state(operator_id());
414
5.10M
    Defer defer([&]() {
415
5.10M
        if (status.ok()) {
416
5.10M
            local_state->update_output_block_counters(*block);
417
5.10M
        }
418
5.10M
    });
419
5.10M
    if (_output_row_descriptor) {
420
297k
        local_state->clear_origin_block();
421
297k
        status = get_block(state, &local_state->_origin_block, eos);
422
297k
        if (UNLIKELY(!status.ok())) {
423
23
            return status;
424
23
        }
425
297k
        status = do_projections(state, &local_state->_origin_block, block);
426
297k
        return status;
427
297k
    }
428
4.80M
    status = get_block(state, block, eos);
429
4.80M
    RETURN_IF_ERROR(block->check_type_and_column());
430
4.80M
    return status;
431
4.80M
}
432
433
3.44M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
434
3.44M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
435
6.82k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
436
6.82k
        *eos = true;
437
6.82k
    }
438
439
3.44M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
440
3.44M
        auto op_name = to_lower(_parent->_op_name);
441
3.44M
        auto arg_op_name = dp->param<std::string>("op_name");
442
3.44M
        arg_op_name = to_lower(arg_op_name);
443
444
3.44M
        if (op_name == arg_op_name) {
445
3.44M
            *eos = true;
446
3.44M
        }
447
3.44M
    });
448
449
3.44M
    if (auto rows = block->rows()) {
450
959k
        _num_rows_returned += rows;
451
959k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
452
959k
    }
453
3.44M
}
454
455
30.3k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
456
30.3k
    auto result = state->get_sink_local_state_result();
457
30.3k
    if (!result) {
458
0
        return result.error();
459
0
    }
460
30.3k
    return result.value()->terminate(state);
461
30.3k
}
462
463
19.6k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
464
19.6k
    fmt::memory_buffer debug_string_buffer;
465
466
19.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
467
19.6k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
468
19.6k
    return fmt::to_string(debug_string_buffer);
469
19.6k
}
470
471
19.6k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
472
19.6k
    return state->get_sink_local_state()->debug_string(indentation_level);
473
19.6k
}
474
475
476k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
476
476k
    std::string op_name = "UNKNOWN_SINK";
477
476k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
478
479
478k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
480
478k
        op_name = it->second;
481
478k
    }
482
476k
    _name = op_name + "_OPERATOR";
483
476k
    return Status::OK();
484
476k
}
485
486
326k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
487
326k
    std::string op_name = print_plan_node_type(tnode.node_type);
488
326k
    _nereids_id = tnode.nereids_id;
489
326k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
490
326k
    _name = substr + "_SINK_OPERATOR";
491
326k
    return Status::OK();
492
326k
}
493
494
template <typename LocalStateType>
495
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
496
2.29M
                                                            LocalSinkStateInfo& info) {
497
2.29M
    auto local_state = LocalStateType::create_unique(this, state);
498
2.29M
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.29M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.29M
    return Status::OK();
501
2.29M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
122k
                                                            LocalSinkStateInfo& info) {
497
122k
    auto local_state = LocalStateType::create_unique(this, state);
498
122k
    RETURN_IF_ERROR(local_state->init(state, info));
499
122k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
122k
    return Status::OK();
501
122k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
489k
                                                            LocalSinkStateInfo& info) {
497
489k
    auto local_state = LocalStateType::create_unique(this, state);
498
489k
    RETURN_IF_ERROR(local_state->init(state, info));
499
489k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
489k
    return Status::OK();
501
489k
}
_ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
86
                                                            LocalSinkStateInfo& info) {
497
86
    auto local_state = LocalStateType::create_unique(this, state);
498
86
    RETURN_IF_ERROR(local_state->init(state, info));
499
86
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
86
    return Status::OK();
501
86
}
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
3
                                                            LocalSinkStateInfo& info) {
497
3
    auto local_state = LocalStateType::create_unique(this, state);
498
3
    RETURN_IF_ERROR(local_state->init(state, info));
499
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
3
    return Status::OK();
501
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
525
                                                            LocalSinkStateInfo& info) {
497
525
    auto local_state = LocalStateType::create_unique(this, state);
498
525
    RETURN_IF_ERROR(local_state->init(state, info));
499
525
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
525
    return Status::OK();
501
525
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
46.8k
                                                            LocalSinkStateInfo& info) {
497
46.8k
    auto local_state = LocalStateType::create_unique(this, state);
498
46.8k
    RETURN_IF_ERROR(local_state->init(state, info));
499
46.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
46.8k
    return Status::OK();
501
46.8k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
9.63k
                                                            LocalSinkStateInfo& info) {
497
9.63k
    auto local_state = LocalStateType::create_unique(this, state);
498
9.63k
    RETURN_IF_ERROR(local_state->init(state, info));
499
9.63k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
9.63k
    return Status::OK();
501
9.63k
}
_ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
5.23k
                                                            LocalSinkStateInfo& info) {
497
5.23k
    auto local_state = LocalStateType::create_unique(this, state);
498
5.23k
    RETURN_IF_ERROR(local_state->init(state, info));
499
5.23k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
5.23k
    return Status::OK();
501
5.23k
}
_ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
156
                                                            LocalSinkStateInfo& info) {
497
156
    auto local_state = LocalStateType::create_unique(this, state);
498
156
    RETURN_IF_ERROR(local_state->init(state, info));
499
156
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
156
    return Status::OK();
501
156
}
_ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
4.04k
                                                            LocalSinkStateInfo& info) {
497
4.04k
    auto local_state = LocalStateType::create_unique(this, state);
498
4.04k
    RETURN_IF_ERROR(local_state->init(state, info));
499
4.04k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
4.04k
    return Status::OK();
501
4.04k
}
_ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
48
                                                            LocalSinkStateInfo& info) {
497
48
    auto local_state = LocalStateType::create_unique(this, state);
498
48
    RETURN_IF_ERROR(local_state->init(state, info));
499
48
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
48
    return Status::OK();
501
48
}
_ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
704
                                                            LocalSinkStateInfo& info) {
497
704
    auto local_state = LocalStateType::create_unique(this, state);
498
704
    RETURN_IF_ERROR(local_state->init(state, info));
499
704
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
704
    return Status::OK();
501
704
}
_ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
1.77k
                                                            LocalSinkStateInfo& info) {
497
1.77k
    auto local_state = LocalStateType::create_unique(this, state);
498
1.77k
    RETURN_IF_ERROR(local_state->init(state, info));
499
1.77k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
1.77k
    return Status::OK();
501
1.77k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
10.0k
                                                            LocalSinkStateInfo& info) {
497
10.0k
    auto local_state = LocalStateType::create_unique(this, state);
498
10.0k
    RETURN_IF_ERROR(local_state->init(state, info));
499
10.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
10.0k
    return Status::OK();
501
10.0k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
128
                                                            LocalSinkStateInfo& info) {
497
128
    auto local_state = LocalStateType::create_unique(this, state);
498
128
    RETURN_IF_ERROR(local_state->init(state, info));
499
128
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
128
    return Status::OK();
501
128
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
274k
                                                            LocalSinkStateInfo& info) {
497
274k
    auto local_state = LocalStateType::create_unique(this, state);
498
274k
    RETURN_IF_ERROR(local_state->init(state, info));
499
274k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
274k
    return Status::OK();
501
274k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
31
                                                            LocalSinkStateInfo& info) {
497
31
    auto local_state = LocalStateType::create_unique(this, state);
498
31
    RETURN_IF_ERROR(local_state->init(state, info));
499
31
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
31
    return Status::OK();
501
31
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
360k
                                                            LocalSinkStateInfo& info) {
497
360k
    auto local_state = LocalStateType::create_unique(this, state);
498
360k
    RETURN_IF_ERROR(local_state->init(state, info));
499
360k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
360k
    return Status::OK();
501
360k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
163k
                                                            LocalSinkStateInfo& info) {
497
163k
    auto local_state = LocalStateType::create_unique(this, state);
498
163k
    RETURN_IF_ERROR(local_state->init(state, info));
499
163k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
163k
    return Status::OK();
501
163k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
560
                                                            LocalSinkStateInfo& info) {
497
560
    auto local_state = LocalStateType::create_unique(this, state);
498
560
    RETURN_IF_ERROR(local_state->init(state, info));
499
560
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
560
    return Status::OK();
501
560
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
38
                                                            LocalSinkStateInfo& info) {
497
38
    auto local_state = LocalStateType::create_unique(this, state);
498
38
    RETURN_IF_ERROR(local_state->init(state, info));
499
38
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
38
    return Status::OK();
501
38
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
764k
                                                            LocalSinkStateInfo& info) {
497
764k
    auto local_state = LocalStateType::create_unique(this, state);
498
764k
    RETURN_IF_ERROR(local_state->init(state, info));
499
764k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
764k
    return Status::OK();
501
764k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
11.3k
                                                            LocalSinkStateInfo& info) {
497
11.3k
    auto local_state = LocalStateType::create_unique(this, state);
498
11.3k
    RETURN_IF_ERROR(local_state->init(state, info));
499
11.3k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
11.3k
    return Status::OK();
501
11.3k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
7.71k
                                                            LocalSinkStateInfo& info) {
497
7.71k
    auto local_state = LocalStateType::create_unique(this, state);
498
7.71k
    RETURN_IF_ERROR(local_state->init(state, info));
499
7.71k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
7.71k
    return Status::OK();
501
7.71k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
3.70k
                                                            LocalSinkStateInfo& info) {
497
3.70k
    auto local_state = LocalStateType::create_unique(this, state);
498
3.70k
    RETURN_IF_ERROR(local_state->init(state, info));
499
3.70k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
3.70k
    return Status::OK();
501
3.70k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
625
                                                            LocalSinkStateInfo& info) {
497
625
    auto local_state = LocalStateType::create_unique(this, state);
498
625
    RETURN_IF_ERROR(local_state->init(state, info));
499
625
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
625
    return Status::OK();
501
625
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
4.89k
                                                            LocalSinkStateInfo& info) {
497
4.89k
    auto local_state = LocalStateType::create_unique(this, state);
498
4.89k
    RETURN_IF_ERROR(local_state->init(state, info));
499
4.89k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
4.89k
    return Status::OK();
501
4.89k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
2.65k
                                                            LocalSinkStateInfo& info) {
497
2.65k
    auto local_state = LocalStateType::create_unique(this, state);
498
2.65k
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.65k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.65k
    return Status::OK();
501
2.65k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
2.68k
                                                            LocalSinkStateInfo& info) {
497
2.68k
    auto local_state = LocalStateType::create_unique(this, state);
498
2.68k
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.68k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.68k
    return Status::OK();
501
2.68k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
2.59k
                                                            LocalSinkStateInfo& info) {
497
2.59k
    auto local_state = LocalStateType::create_unique(this, state);
498
2.59k
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.59k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.59k
    return Status::OK();
501
2.59k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
1
                                                            LocalSinkStateInfo& info) {
497
1
    auto local_state = LocalStateType::create_unique(this, state);
498
1
    RETURN_IF_ERROR(local_state->init(state, info));
499
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
1
    return Status::OK();
501
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
567
                                                            LocalSinkStateInfo& info) {
497
567
    auto local_state = LocalStateType::create_unique(this, state);
498
567
    RETURN_IF_ERROR(local_state->init(state, info));
499
567
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
567
    return Status::OK();
501
567
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
14
                                                            LocalSinkStateInfo& info) {
497
14
    auto local_state = LocalStateType::create_unique(this, state);
498
14
    RETURN_IF_ERROR(local_state->init(state, info));
499
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
14
    return Status::OK();
501
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
99
                                                            LocalSinkStateInfo& info) {
497
99
    auto local_state = LocalStateType::create_unique(this, state);
498
99
    RETURN_IF_ERROR(local_state->init(state, info));
499
99
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
99
    return Status::OK();
501
99
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
164
                                                            LocalSinkStateInfo& info) {
497
164
    auto local_state = LocalStateType::create_unique(this, state);
498
164
    RETURN_IF_ERROR(local_state->init(state, info));
499
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
164
    return Status::OK();
501
164
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
164
                                                            LocalSinkStateInfo& info) {
497
164
    auto local_state = LocalStateType::create_unique(this, state);
498
164
    RETURN_IF_ERROR(local_state->init(state, info));
499
164
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
164
    return Status::OK();
501
164
}
502
503
template <typename LocalStateType>
504
1.89M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
0
                                 LocalExchangeSharedState>) {
507
0
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
0
                                        MultiCastSharedState>) {
510
0
        throw Exception(Status::FatalError("should not reach here!"));
511
1.89M
    } else {
512
1.89M
        auto ss = LocalStateType::SharedStateType::create_shared();
513
1.89M
        ss->id = operator_id();
514
1.89M
        for (auto& dest : dests_id()) {
515
1.88M
            ss->related_op_ids.insert(dest);
516
1.88M
        }
517
1.89M
        return ss;
518
1.89M
    }
519
1.89M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
103k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
103k
    } else {
512
103k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
103k
        ss->id = operator_id();
514
103k
        for (auto& dest : dests_id()) {
515
103k
            ss->related_op_ids.insert(dest);
516
103k
        }
517
103k
        return ss;
518
103k
    }
519
103k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
490k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
490k
    } else {
512
490k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
490k
        ss->id = operator_id();
514
490k
        for (auto& dest : dests_id()) {
515
489k
            ss->related_op_ids.insert(dest);
516
489k
        }
517
490k
        return ss;
518
490k
    }
519
490k
}
_ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
86
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
86
    } else {
512
86
        auto ss = LocalStateType::SharedStateType::create_shared();
513
86
        ss->id = operator_id();
514
86
        for (auto& dest : dests_id()) {
515
86
            ss->related_op_ids.insert(dest);
516
86
        }
517
86
        return ss;
518
86
    }
519
86
}
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
3
    } else {
512
3
        auto ss = LocalStateType::SharedStateType::create_shared();
513
3
        ss->id = operator_id();
514
3
        for (auto& dest : dests_id()) {
515
3
            ss->related_op_ids.insert(dest);
516
3
        }
517
3
        return ss;
518
3
    }
519
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
520
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
520
    } else {
512
520
        auto ss = LocalStateType::SharedStateType::create_shared();
513
520
        ss->id = operator_id();
514
524
        for (auto& dest : dests_id()) {
515
524
            ss->related_op_ids.insert(dest);
516
524
        }
517
520
        return ss;
518
520
    }
519
520
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
46.8k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
46.8k
    } else {
512
46.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
46.8k
        ss->id = operator_id();
514
46.8k
        for (auto& dest : dests_id()) {
515
46.6k
            ss->related_op_ids.insert(dest);
516
46.6k
        }
517
46.8k
        return ss;
518
46.8k
    }
519
46.8k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
504
9.63k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
9.63k
    } else {
512
9.63k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
9.63k
        ss->id = operator_id();
514
9.63k
        for (auto& dest : dests_id()) {
515
9.63k
            ss->related_op_ids.insert(dest);
516
9.63k
        }
517
9.63k
        return ss;
518
9.63k
    }
519
9.63k
}
_ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
5.23k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
5.23k
    } else {
512
5.23k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
5.23k
        ss->id = operator_id();
514
5.23k
        for (auto& dest : dests_id()) {
515
5.23k
            ss->related_op_ids.insert(dest);
516
5.23k
        }
517
5.23k
        return ss;
518
5.23k
    }
519
5.23k
}
_ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
156
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
156
    } else {
512
156
        auto ss = LocalStateType::SharedStateType::create_shared();
513
156
        ss->id = operator_id();
514
156
        for (auto& dest : dests_id()) {
515
156
            ss->related_op_ids.insert(dest);
516
156
        }
517
156
        return ss;
518
156
    }
519
156
}
_ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
4.04k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
4.04k
    } else {
512
4.04k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
4.04k
        ss->id = operator_id();
514
4.04k
        for (auto& dest : dests_id()) {
515
4.04k
            ss->related_op_ids.insert(dest);
516
4.04k
        }
517
4.04k
        return ss;
518
4.04k
    }
519
4.04k
}
_ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
48
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
48
    } else {
512
48
        auto ss = LocalStateType::SharedStateType::create_shared();
513
48
        ss->id = operator_id();
514
48
        for (auto& dest : dests_id()) {
515
48
            ss->related_op_ids.insert(dest);
516
48
        }
517
48
        return ss;
518
48
    }
519
48
}
_ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
704
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
704
    } else {
512
704
        auto ss = LocalStateType::SharedStateType::create_shared();
513
704
        ss->id = operator_id();
514
704
        for (auto& dest : dests_id()) {
515
704
            ss->related_op_ids.insert(dest);
516
704
        }
517
704
        return ss;
518
704
    }
519
704
}
_ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
1.77k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
1.77k
    } else {
512
1.77k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
1.77k
        ss->id = operator_id();
514
1.77k
        for (auto& dest : dests_id()) {
515
1.77k
            ss->related_op_ids.insert(dest);
516
1.77k
        }
517
1.77k
        return ss;
518
1.77k
    }
519
1.77k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
10.0k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
10.0k
    } else {
512
10.0k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
10.0k
        ss->id = operator_id();
514
10.0k
        for (auto& dest : dests_id()) {
515
10.0k
            ss->related_op_ids.insert(dest);
516
10.0k
        }
517
10.0k
        return ss;
518
10.0k
    }
519
10.0k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
128
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
128
    } else {
512
128
        auto ss = LocalStateType::SharedStateType::create_shared();
513
128
        ss->id = operator_id();
514
128
        for (auto& dest : dests_id()) {
515
128
            ss->related_op_ids.insert(dest);
516
128
        }
517
128
        return ss;
518
128
    }
519
128
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
274k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
274k
    } else {
512
274k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
274k
        ss->id = operator_id();
514
274k
        for (auto& dest : dests_id()) {
515
273k
            ss->related_op_ids.insert(dest);
516
273k
        }
517
274k
        return ss;
518
274k
    }
519
274k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
33
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
33
    } else {
512
33
        auto ss = LocalStateType::SharedStateType::create_shared();
513
33
        ss->id = operator_id();
514
33
        for (auto& dest : dests_id()) {
515
33
            ss->related_op_ids.insert(dest);
516
33
        }
517
33
        return ss;
518
33
    }
519
33
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
163k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
163k
    } else {
512
163k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
163k
        ss->id = operator_id();
514
163k
        for (auto& dest : dests_id()) {
515
163k
            ss->related_op_ids.insert(dest);
516
163k
        }
517
163k
        return ss;
518
163k
    }
519
163k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
37
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
37
    } else {
512
37
        auto ss = LocalStateType::SharedStateType::create_shared();
513
37
        ss->id = operator_id();
514
37
        for (auto& dest : dests_id()) {
515
37
            ss->related_op_ids.insert(dest);
516
37
        }
517
37
        return ss;
518
37
    }
519
37
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
762k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
762k
    } else {
512
762k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
762k
        ss->id = operator_id();
514
762k
        for (auto& dest : dests_id()) {
515
761k
            ss->related_op_ids.insert(dest);
516
761k
        }
517
762k
        return ss;
518
762k
    }
519
762k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
11.3k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
11.3k
    } else {
512
11.3k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
11.3k
        ss->id = operator_id();
514
11.3k
        for (auto& dest : dests_id()) {
515
11.3k
            ss->related_op_ids.insert(dest);
516
11.3k
        }
517
11.3k
        return ss;
518
11.3k
    }
519
11.3k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
725
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
725
    } else {
512
725
        auto ss = LocalStateType::SharedStateType::create_shared();
513
725
        ss->id = operator_id();
514
727
        for (auto& dest : dests_id()) {
515
727
            ss->related_op_ids.insert(dest);
516
727
        }
517
725
        return ss;
518
725
    }
519
725
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
504
2.68k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
2.68k
    } else {
512
2.68k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
2.68k
        ss->id = operator_id();
514
2.68k
        for (auto& dest : dests_id()) {
515
2.65k
            ss->related_op_ids.insert(dest);
516
2.65k
        }
517
2.68k
        return ss;
518
2.68k
    }
519
2.68k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
504
2.59k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
2.59k
    } else {
512
2.59k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
2.59k
        ss->id = operator_id();
514
2.59k
        for (auto& dest : dests_id()) {
515
2.58k
            ss->related_op_ids.insert(dest);
516
2.58k
        }
517
2.59k
        return ss;
518
2.59k
    }
519
2.59k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
569
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
569
    } else {
512
569
        auto ss = LocalStateType::SharedStateType::create_shared();
513
569
        ss->id = operator_id();
514
569
        for (auto& dest : dests_id()) {
515
568
            ss->related_op_ids.insert(dest);
516
568
        }
517
569
        return ss;
518
569
    }
519
569
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
101
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
101
    } else {
512
101
        auto ss = LocalStateType::SharedStateType::create_shared();
513
101
        ss->id = operator_id();
514
101
        for (auto& dest : dests_id()) {
515
101
            ss->related_op_ids.insert(dest);
516
101
        }
517
101
        return ss;
518
101
    }
519
101
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
520
521
template <typename LocalStateType>
522
2.84M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.84M
    auto local_state = LocalStateType::create_unique(state, this);
524
2.84M
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.84M
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.84M
    return Status::OK();
527
2.84M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
73.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
73.8k
    auto local_state = LocalStateType::create_unique(state, this);
524
73.8k
    RETURN_IF_ERROR(local_state->init(state, info));
525
73.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
73.8k
    return Status::OK();
527
73.8k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
315k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
315k
    auto local_state = LocalStateType::create_unique(state, this);
524
315k
    RETURN_IF_ERROR(local_state->init(state, info));
525
315k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
315k
    return Status::OK();
527
315k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
145
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
145
    auto local_state = LocalStateType::create_unique(state, this);
524
145
    RETURN_IF_ERROR(local_state->init(state, info));
525
145
    state->emplace_local_state(operator_id(), std::move(local_state));
526
145
    return Status::OK();
527
145
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
38.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
38.6k
    auto local_state = LocalStateType::create_unique(state, this);
524
38.6k
    RETURN_IF_ERROR(local_state->init(state, info));
525
38.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
38.6k
    return Status::OK();
527
38.6k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
10.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
10.0k
    auto local_state = LocalStateType::create_unique(state, this);
524
10.0k
    RETURN_IF_ERROR(local_state->init(state, info));
525
10.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
10.0k
    return Status::OK();
527
10.0k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
10.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
10.3k
    auto local_state = LocalStateType::create_unique(state, this);
524
10.3k
    RETURN_IF_ERROR(local_state->init(state, info));
525
10.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
10.3k
    return Status::OK();
527
10.3k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
24
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
24
    auto local_state = LocalStateType::create_unique(state, this);
524
24
    RETURN_IF_ERROR(local_state->init(state, info));
525
24
    state->emplace_local_state(operator_id(), std::move(local_state));
526
24
    return Status::OK();
527
24
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
262k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
262k
    auto local_state = LocalStateType::create_unique(state, this);
524
262k
    RETURN_IF_ERROR(local_state->init(state, info));
525
262k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
262k
    return Status::OK();
527
262k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
162k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
162k
    auto local_state = LocalStateType::create_unique(state, this);
524
162k
    RETURN_IF_ERROR(local_state->init(state, info));
525
162k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
162k
    return Status::OK();
527
162k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
558
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
558
    auto local_state = LocalStateType::create_unique(state, this);
524
558
    RETURN_IF_ERROR(local_state->init(state, info));
525
558
    state->emplace_local_state(operator_id(), std::move(local_state));
526
558
    return Status::OK();
527
558
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
28
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
28
    auto local_state = LocalStateType::create_unique(state, this);
524
28
    RETURN_IF_ERROR(local_state->init(state, info));
525
28
    state->emplace_local_state(operator_id(), std::move(local_state));
526
28
    return Status::OK();
527
28
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
4.12k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
4.12k
    auto local_state = LocalStateType::create_unique(state, this);
524
4.12k
    RETURN_IF_ERROR(local_state->init(state, info));
525
4.12k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
4.12k
    return Status::OK();
527
4.12k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
431k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
431k
    auto local_state = LocalStateType::create_unique(state, this);
524
431k
    RETURN_IF_ERROR(local_state->init(state, info));
525
431k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
431k
    return Status::OK();
527
431k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
1.39k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.39k
    auto local_state = LocalStateType::create_unique(state, this);
524
1.39k
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.39k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.39k
    return Status::OK();
527
1.39k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
11.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
11.3k
    auto local_state = LocalStateType::create_unique(state, this);
524
11.3k
    RETURN_IF_ERROR(local_state->init(state, info));
525
11.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
11.3k
    return Status::OK();
527
11.3k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
221
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
221
    auto local_state = LocalStateType::create_unique(state, this);
524
221
    RETURN_IF_ERROR(local_state->init(state, info));
525
221
    state->emplace_local_state(operator_id(), std::move(local_state));
526
221
    return Status::OK();
527
221
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
1.99k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.99k
    auto local_state = LocalStateType::create_unique(state, this);
524
1.99k
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.99k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.99k
    return Status::OK();
527
1.99k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
57.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
57.0k
    auto local_state = LocalStateType::create_unique(state, this);
524
57.0k
    RETURN_IF_ERROR(local_state->init(state, info));
525
57.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
57.0k
    return Status::OK();
527
57.0k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
10.4k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
10.4k
    auto local_state = LocalStateType::create_unique(state, this);
524
10.4k
    RETURN_IF_ERROR(local_state->init(state, info));
525
10.4k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
10.4k
    return Status::OK();
527
10.4k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
616
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
616
    auto local_state = LocalStateType::create_unique(state, this);
524
616
    RETURN_IF_ERROR(local_state->init(state, info));
525
616
    state->emplace_local_state(operator_id(), std::move(local_state));
526
616
    return Status::OK();
527
616
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
2.64k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.64k
    auto local_state = LocalStateType::create_unique(state, this);
524
2.64k
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.64k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.64k
    return Status::OK();
527
2.64k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
2.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.54k
    auto local_state = LocalStateType::create_unique(state, this);
524
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.54k
    return Status::OK();
527
2.54k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
521
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
521
    auto local_state = LocalStateType::create_unique(state, this);
524
521
    RETURN_IF_ERROR(local_state->init(state, info));
525
521
    state->emplace_local_state(operator_id(), std::move(local_state));
526
521
    return Status::OK();
527
521
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
2.23k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.23k
    auto local_state = LocalStateType::create_unique(state, this);
524
2.23k
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.23k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.23k
    return Status::OK();
527
2.23k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
6.76k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
6.76k
    auto local_state = LocalStateType::create_unique(state, this);
524
6.76k
    RETURN_IF_ERROR(local_state->init(state, info));
525
6.76k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
6.76k
    return Status::OK();
527
6.76k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
896k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
896k
    auto local_state = LocalStateType::create_unique(state, this);
524
896k
    RETURN_IF_ERROR(local_state->init(state, info));
525
896k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
896k
    return Status::OK();
527
896k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
14
    auto local_state = LocalStateType::create_unique(state, this);
524
14
    RETURN_IF_ERROR(local_state->init(state, info));
525
14
    state->emplace_local_state(operator_id(), std::move(local_state));
526
14
    return Status::OK();
527
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
164
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
164
    auto local_state = LocalStateType::create_unique(state, this);
524
164
    RETURN_IF_ERROR(local_state->init(state, info));
525
164
    state->emplace_local_state(operator_id(), std::move(local_state));
526
164
    return Status::OK();
527
164
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
2.19k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.19k
    auto local_state = LocalStateType::create_unique(state, this);
524
2.19k
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.19k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.19k
    return Status::OK();
527
2.19k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
1.74k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.74k
    auto local_state = LocalStateType::create_unique(state, this);
524
1.74k
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.74k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.74k
    return Status::OK();
527
1.74k
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
2.64k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.64k
    auto local_state = LocalStateType::create_unique(state, this);
524
2.64k
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.64k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.64k
    return Status::OK();
527
2.64k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
12.6k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
12.6k
    auto local_state = LocalStateType::create_unique(state, this);
524
12.6k
    RETURN_IF_ERROR(local_state->init(state, info));
525
12.6k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
12.6k
    return Status::OK();
527
12.6k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
515k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
515k
    auto local_state = LocalStateType::create_unique(state, this);
524
515k
    RETURN_IF_ERROR(local_state->init(state, info));
525
515k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
515k
    return Status::OK();
527
515k
}
528
529
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
530
                                                         RuntimeState* state)
531
2.28M
        : _parent(parent), _state(state) {}
532
533
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
534
2.83M
        : _num_rows_returned(0),
535
2.83M
          _rows_returned_counter(nullptr),
536
2.83M
          _parent(parent),
537
2.83M
          _state(state),
538
2.83M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
539
540
template <typename SharedStateArg>
541
2.84M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
2.84M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
2.84M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
2.84M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
2.84M
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
2.84M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
2.84M
    _operator_profile->add_child(_common_profile.get(), true);
550
2.84M
    _operator_profile->add_child(_custom_profile.get(), true);
551
2.84M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
2.84M
    if constexpr (!is_fake_shared) {
553
1.50M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
917k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
917k
                                    .first.get()
556
917k
                                    ->template cast<SharedStateArg>();
557
558
917k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
917k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
917k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
917k
        } else if (info.shared_state) {
562
531k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
0
                DCHECK(false);
564
0
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
531k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
531k
            _dependency = _shared_state->create_source_dependency(
569
531k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
531k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
531k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
531k
        } else {
573
57.4k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
1.76k
                DCHECK(false);
575
1.76k
            }
576
57.4k
        }
577
1.50M
    }
578
579
2.84M
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
2.84M
    _rows_returned_counter =
584
2.84M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
2.84M
    _blocks_returned_counter =
586
2.84M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
2.84M
    _output_block_bytes_counter =
588
2.84M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
2.84M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
2.84M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
2.84M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
2.84M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
2.84M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
2.84M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
2.84M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
2.84M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
2.84M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
2.84M
    _memory_used_counter =
599
2.84M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
2.84M
    _common_profile->add_info_string("IsColocate",
601
2.84M
                                     std::to_string(_parent->is_colocated_operator()));
602
2.84M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
2.84M
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
2.84M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
2.84M
    return Status::OK();
606
2.84M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
73.7k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
73.7k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
73.7k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
73.7k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
73.7k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
73.7k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
73.7k
    _operator_profile->add_child(_common_profile.get(), true);
550
73.7k
    _operator_profile->add_child(_custom_profile.get(), true);
551
73.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
73.7k
    if constexpr (!is_fake_shared) {
553
73.7k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
18.6k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
18.6k
                                    .first.get()
556
18.6k
                                    ->template cast<SharedStateArg>();
557
558
18.6k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
18.6k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
18.6k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
55.1k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
55.1k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
55.1k
            _dependency = _shared_state->create_source_dependency(
569
55.1k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
55.1k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
55.1k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
55.1k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
23
        }
577
73.7k
    }
578
579
73.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
73.7k
    _rows_returned_counter =
584
73.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
73.7k
    _blocks_returned_counter =
586
73.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
73.7k
    _output_block_bytes_counter =
588
73.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
73.7k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
73.7k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
73.7k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
73.7k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
73.7k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
73.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
73.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
73.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
73.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
73.7k
    _memory_used_counter =
599
73.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
73.7k
    _common_profile->add_info_string("IsColocate",
601
73.7k
                                     std::to_string(_parent->is_colocated_operator()));
602
73.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
73.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
73.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
73.7k
    return Status::OK();
606
73.7k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
1
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
1
    _operator_profile->add_child(_common_profile.get(), true);
550
1
    _operator_profile->add_child(_custom_profile.get(), true);
551
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
1
    if constexpr (!is_fake_shared) {
553
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
1
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
1
            _dependency = _shared_state->create_source_dependency(
569
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
1
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
1
    }
578
579
1
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
1
    _rows_returned_counter =
584
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
1
    _blocks_returned_counter =
586
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
1
    _output_block_bytes_counter =
588
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
1
    _memory_used_counter =
599
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
1
    _common_profile->add_info_string("IsColocate",
601
1
                                     std::to_string(_parent->is_colocated_operator()));
602
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
1
    return Status::OK();
606
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
274k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
274k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
274k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
274k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
274k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
274k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
274k
    _operator_profile->add_child(_common_profile.get(), true);
550
274k
    _operator_profile->add_child(_custom_profile.get(), true);
551
274k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
274k
    if constexpr (!is_fake_shared) {
553
274k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
274k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
272k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
272k
            _dependency = _shared_state->create_source_dependency(
569
272k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
272k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
272k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
272k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
1.66k
        }
577
274k
    }
578
579
274k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
274k
    _rows_returned_counter =
584
274k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
274k
    _blocks_returned_counter =
586
274k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
274k
    _output_block_bytes_counter =
588
274k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
274k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
274k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
274k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
274k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
274k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
274k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
274k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
274k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
274k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
274k
    _memory_used_counter =
599
274k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
274k
    _common_profile->add_info_string("IsColocate",
601
274k
                                     std::to_string(_parent->is_colocated_operator()));
602
274k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
274k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
274k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
274k
    return Status::OK();
606
274k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
24
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
24
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
24
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
24
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
24
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
24
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
24
    _operator_profile->add_child(_common_profile.get(), true);
550
24
    _operator_profile->add_child(_custom_profile.get(), true);
551
24
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
24
    if constexpr (!is_fake_shared) {
553
24
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
24
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
24
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
24
            _dependency = _shared_state->create_source_dependency(
569
24
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
24
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
24
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
24
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
24
    }
578
579
24
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
24
    _rows_returned_counter =
584
24
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
24
    _blocks_returned_counter =
586
24
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
24
    _output_block_bytes_counter =
588
24
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
24
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
24
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
24
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
24
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
24
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
24
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
24
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
24
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
24
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
24
    _memory_used_counter =
599
24
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
24
    _common_profile->add_info_string("IsColocate",
601
24
                                     std::to_string(_parent->is_colocated_operator()));
602
24
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
24
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
24
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
24
    return Status::OK();
606
24
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
11.3k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
11.3k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
11.3k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
11.3k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
11.3k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
11.3k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
11.3k
    _operator_profile->add_child(_common_profile.get(), true);
550
11.3k
    _operator_profile->add_child(_custom_profile.get(), true);
551
11.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
11.3k
    if constexpr (!is_fake_shared) {
553
11.3k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
11.3k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
11.3k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
11.3k
            _dependency = _shared_state->create_source_dependency(
569
11.3k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
11.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
11.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
18.4E
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
18.4E
        }
577
11.3k
    }
578
579
11.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
11.3k
    _rows_returned_counter =
584
11.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
11.3k
    _blocks_returned_counter =
586
11.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
11.3k
    _output_block_bytes_counter =
588
11.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
11.3k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
11.3k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
11.3k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
11.3k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
11.3k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
11.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
11.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
11.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
11.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
11.3k
    _memory_used_counter =
599
11.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
11.3k
    _common_profile->add_info_string("IsColocate",
601
11.3k
                                     std::to_string(_parent->is_colocated_operator()));
602
11.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
11.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
11.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
11.3k
    return Status::OK();
606
11.3k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
10.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
10.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
10.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
10.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
10.0k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
10.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
10.0k
    _operator_profile->add_child(_common_profile.get(), true);
550
10.0k
    _operator_profile->add_child(_custom_profile.get(), true);
551
10.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
10.0k
    if constexpr (!is_fake_shared) {
553
10.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
10.0k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
10.0k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
10.0k
            _dependency = _shared_state->create_source_dependency(
569
10.0k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
10.0k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
10.0k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
10.0k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
34
        }
577
10.0k
    }
578
579
10.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
10.0k
    _rows_returned_counter =
584
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
10.0k
    _blocks_returned_counter =
586
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
10.0k
    _output_block_bytes_counter =
588
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
10.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
10.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
10.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
10.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
10.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
10.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
10.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
10.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
10.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
10.0k
    _memory_used_counter =
599
10.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
10.0k
    _common_profile->add_info_string("IsColocate",
601
10.0k
                                     std::to_string(_parent->is_colocated_operator()));
602
10.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
10.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
10.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
10.0k
    return Status::OK();
606
10.0k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
163k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
163k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
163k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
163k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
163k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
163k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
163k
    _operator_profile->add_child(_common_profile.get(), true);
550
163k
    _operator_profile->add_child(_custom_profile.get(), true);
551
163k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
163k
    if constexpr (!is_fake_shared) {
553
163k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
163k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
162k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
162k
            _dependency = _shared_state->create_source_dependency(
569
162k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
162k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
162k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
162k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
412
        }
577
163k
    }
578
579
163k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
163k
    _rows_returned_counter =
584
163k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
163k
    _blocks_returned_counter =
586
163k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
163k
    _output_block_bytes_counter =
588
163k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
163k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
163k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
163k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
163k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
163k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
163k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
163k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
163k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
163k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
163k
    _memory_used_counter =
599
163k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
163k
    _common_profile->add_info_string("IsColocate",
601
163k
                                     std::to_string(_parent->is_colocated_operator()));
602
163k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
163k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
163k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
163k
    return Status::OK();
606
163k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
559
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
559
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
559
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
559
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
559
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
559
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
559
    _operator_profile->add_child(_common_profile.get(), true);
550
559
    _operator_profile->add_child(_custom_profile.get(), true);
551
559
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
559
    if constexpr (!is_fake_shared) {
553
559
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
557
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
557
                                    .first.get()
556
557
                                    ->template cast<SharedStateArg>();
557
558
557
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
557
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
557
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
557
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
0
            _dependency = _shared_state->create_source_dependency(
569
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
2
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
2
        }
577
559
    }
578
579
559
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
559
    _rows_returned_counter =
584
559
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
559
    _blocks_returned_counter =
586
559
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
559
    _output_block_bytes_counter =
588
559
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
559
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
559
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
559
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
559
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
559
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
559
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
559
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
559
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
559
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
559
    _memory_used_counter =
599
559
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
559
    _common_profile->add_info_string("IsColocate",
601
559
                                     std::to_string(_parent->is_colocated_operator()));
602
559
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
559
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
559
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
559
    return Status::OK();
606
559
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
28
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
28
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
28
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
28
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
28
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
28
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
28
    _operator_profile->add_child(_common_profile.get(), true);
550
28
    _operator_profile->add_child(_custom_profile.get(), true);
551
28
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
28
    if constexpr (!is_fake_shared) {
553
28
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
28
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
28
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
28
            _dependency = _shared_state->create_source_dependency(
569
28
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
28
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
28
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
28
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
28
    }
578
579
28
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
28
    _rows_returned_counter =
584
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
28
    _blocks_returned_counter =
586
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
28
    _output_block_bytes_counter =
588
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
28
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
28
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
28
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
28
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
28
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
28
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
28
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
28
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
28
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
28
    _memory_used_counter =
599
28
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
28
    _common_profile->add_info_string("IsColocate",
601
28
                                     std::to_string(_parent->is_colocated_operator()));
602
28
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
28
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
28
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
28
    return Status::OK();
606
28
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
1.33M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
1.33M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
1.33M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
1.33M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
1.33M
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
1.33M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
1.33M
    _operator_profile->add_child(_common_profile.get(), true);
550
1.33M
    _operator_profile->add_child(_custom_profile.get(), true);
551
1.33M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
    if constexpr (!is_fake_shared) {
553
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
                                    .first.get()
556
                                    ->template cast<SharedStateArg>();
557
558
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
            _dependency = _shared_state->create_source_dependency(
569
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
        }
577
    }
578
579
1.33M
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
1.33M
    _rows_returned_counter =
584
1.33M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
1.33M
    _blocks_returned_counter =
586
1.33M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
1.33M
    _output_block_bytes_counter =
588
1.33M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
1.33M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
1.33M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
1.33M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
1.33M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
1.33M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
1.33M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
1.33M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
1.33M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
1.33M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
1.33M
    _memory_used_counter =
599
1.33M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
1.33M
    _common_profile->add_info_string("IsColocate",
601
1.33M
                                     std::to_string(_parent->is_colocated_operator()));
602
1.33M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
1.33M
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
1.33M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
1.33M
    return Status::OK();
606
1.33M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
57.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
57.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
57.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
57.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
57.0k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
57.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
57.0k
    _operator_profile->add_child(_common_profile.get(), true);
550
57.0k
    _operator_profile->add_child(_custom_profile.get(), true);
551
57.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
57.0k
    if constexpr (!is_fake_shared) {
553
57.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
57.0k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
3.68k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
3.68k
            _dependency = _shared_state->create_source_dependency(
569
3.68k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
3.68k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
3.68k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
53.3k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
53.3k
        }
577
57.0k
    }
578
579
57.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
57.0k
    _rows_returned_counter =
584
57.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
57.0k
    _blocks_returned_counter =
586
57.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
57.0k
    _output_block_bytes_counter =
588
57.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
57.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
57.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
57.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
57.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
57.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
57.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
57.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
57.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
57.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
57.0k
    _memory_used_counter =
599
57.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
57.0k
    _common_profile->add_info_string("IsColocate",
601
57.0k
                                     std::to_string(_parent->is_colocated_operator()));
602
57.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
57.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
57.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
57.0k
    return Status::OK();
606
57.0k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
26
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
26
    _operator_profile->add_child(_common_profile.get(), true);
550
26
    _operator_profile->add_child(_custom_profile.get(), true);
551
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
26
    if constexpr (!is_fake_shared) {
553
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
26
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
26
            _dependency = _shared_state->create_source_dependency(
569
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
26
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
26
    }
578
579
26
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
26
    _rows_returned_counter =
584
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
26
    _blocks_returned_counter =
586
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
26
    _output_block_bytes_counter =
588
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
26
    _memory_used_counter =
599
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
26
    _common_profile->add_info_string("IsColocate",
601
26
                                     std::to_string(_parent->is_colocated_operator()));
602
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
26
    return Status::OK();
606
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
10.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
10.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
10.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
10.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
10.4k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
10.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
10.4k
    _operator_profile->add_child(_common_profile.get(), true);
550
10.4k
    _operator_profile->add_child(_custom_profile.get(), true);
551
10.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
10.4k
    if constexpr (!is_fake_shared) {
553
10.4k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
10.4k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
10.4k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
10.4k
            _dependency = _shared_state->create_source_dependency(
569
10.4k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
10.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
10.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
10.4k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
5
        }
577
10.4k
    }
578
579
10.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
10.4k
    _rows_returned_counter =
584
10.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
10.4k
    _blocks_returned_counter =
586
10.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
10.4k
    _output_block_bytes_counter =
588
10.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
10.4k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
10.4k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
10.4k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
10.4k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
10.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
10.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
10.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
10.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
10.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
10.4k
    _memory_used_counter =
599
10.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
10.4k
    _common_profile->add_info_string("IsColocate",
601
10.4k
                                     std::to_string(_parent->is_colocated_operator()));
602
10.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
10.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
10.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
10.4k
    return Status::OK();
606
10.4k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
725
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
725
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
725
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
725
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
725
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
725
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
725
    _operator_profile->add_child(_common_profile.get(), true);
550
725
    _operator_profile->add_child(_custom_profile.get(), true);
551
725
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
725
    if constexpr (!is_fake_shared) {
553
725
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
727
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
727
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
727
            _dependency = _shared_state->create_source_dependency(
569
727
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
727
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
727
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
18.4E
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
18.4E
        }
577
725
    }
578
579
725
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
725
    _rows_returned_counter =
584
725
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
725
    _blocks_returned_counter =
586
725
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
725
    _output_block_bytes_counter =
588
725
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
725
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
725
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
725
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
725
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
725
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
725
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
725
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
725
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
725
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
725
    _memory_used_counter =
599
725
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
725
    _common_profile->add_info_string("IsColocate",
601
725
                                     std::to_string(_parent->is_colocated_operator()));
602
725
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
725
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
725
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
725
    return Status::OK();
606
725
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
5.28k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
5.28k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
5.28k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
5.28k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
5.28k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
5.28k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
5.28k
    _operator_profile->add_child(_common_profile.get(), true);
550
5.28k
    _operator_profile->add_child(_custom_profile.get(), true);
551
5.28k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
5.28k
    if constexpr (!is_fake_shared) {
553
5.28k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
5.28k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
5.05k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
5.05k
            _dependency = _shared_state->create_source_dependency(
569
5.05k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
5.05k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
5.05k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
5.05k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
226
        }
577
5.28k
    }
578
579
5.28k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
5.28k
    _rows_returned_counter =
584
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
5.28k
    _blocks_returned_counter =
586
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
5.28k
    _output_block_bytes_counter =
588
5.28k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
5.28k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
5.28k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
5.28k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
5.28k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
5.28k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
5.28k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
5.28k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
5.28k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
5.28k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
5.28k
    _memory_used_counter =
599
5.28k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
5.28k
    _common_profile->add_info_string("IsColocate",
601
5.28k
                                     std::to_string(_parent->is_colocated_operator()));
602
5.28k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
5.28k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
5.28k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
5.28k
    return Status::OK();
606
5.28k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
900k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
900k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
900k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
900k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
900k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
900k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
900k
    _operator_profile->add_child(_common_profile.get(), true);
550
900k
    _operator_profile->add_child(_custom_profile.get(), true);
551
900k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
900k
    if constexpr (!is_fake_shared) {
553
900k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
898k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
898k
                                    .first.get()
556
898k
                                    ->template cast<SharedStateArg>();
557
558
898k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
898k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
898k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
898k
        } else if (info.shared_state) {
562
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
0
                DCHECK(false);
564
0
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
0
            _dependency = _shared_state->create_source_dependency(
569
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
1.76k
        } else {
573
1.76k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
1.76k
                DCHECK(false);
575
1.76k
            }
576
1.76k
        }
577
900k
    }
578
579
900k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
900k
    _rows_returned_counter =
584
900k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
900k
    _blocks_returned_counter =
586
900k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
900k
    _output_block_bytes_counter =
588
900k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
900k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
900k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
900k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
900k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
900k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
900k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
900k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
900k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
900k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
900k
    _memory_used_counter =
599
900k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
900k
    _common_profile->add_info_string("IsColocate",
601
900k
                                     std::to_string(_parent->is_colocated_operator()));
602
900k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
900k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
900k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
900k
    return Status::OK();
606
900k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
164
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
164
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
164
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
164
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
164
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
164
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
164
    _operator_profile->add_child(_common_profile.get(), true);
550
164
    _operator_profile->add_child(_custom_profile.get(), true);
551
164
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
164
    if constexpr (!is_fake_shared) {
553
164
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
164
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
164
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
164
            _dependency = _shared_state->create_source_dependency(
569
164
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
164
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
164
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
164
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
164
    }
578
579
164
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
164
    _rows_returned_counter =
584
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
164
    _blocks_returned_counter =
586
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
164
    _output_block_bytes_counter =
588
164
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
164
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
164
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
164
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
164
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
164
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
164
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
164
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
164
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
164
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
164
    _memory_used_counter =
599
164
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
164
    _common_profile->add_info_string("IsColocate",
601
164
                                     std::to_string(_parent->is_colocated_operator()));
602
164
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
164
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
164
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
164
    return Status::OK();
606
164
}
607
608
template <typename SharedStateArg>
609
2.85M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
2.85M
    _conjuncts.resize(_parent->_conjuncts.size());
611
2.85M
    _projections.resize(_parent->_projections.size());
612
3.39M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
541k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
541k
    }
615
5.74M
    for (size_t i = 0; i < _projections.size(); i++) {
616
2.89M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
2.89M
    }
618
2.85M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
2.86M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
12.1k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
96.7k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
84.6k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
84.6k
                    state, _intermediate_projections[i][j]));
624
84.6k
        }
625
12.1k
    }
626
2.85M
    return Status::OK();
627
2.85M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
74.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
74.0k
    _conjuncts.resize(_parent->_conjuncts.size());
611
74.0k
    _projections.resize(_parent->_projections.size());
612
74.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
859
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
859
    }
615
376k
    for (size_t i = 0; i < _projections.size(); i++) {
616
302k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
302k
    }
618
74.0k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
77.2k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
3.19k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
42.6k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
39.4k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
39.4k
                    state, _intermediate_projections[i][j]));
624
39.4k
        }
625
3.19k
    }
626
74.0k
    return Status::OK();
627
74.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
3
    _conjuncts.resize(_parent->_conjuncts.size());
611
3
    _projections.resize(_parent->_projections.size());
612
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
3
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
3
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
3
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
3
    return Status::OK();
627
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
274k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
274k
    _conjuncts.resize(_parent->_conjuncts.size());
611
274k
    _projections.resize(_parent->_projections.size());
612
274k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
274k
    for (size_t i = 0; i < _projections.size(); i++) {
616
365
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
365
    }
618
274k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
274k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
274k
    return Status::OK();
627
274k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
24
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
24
    _conjuncts.resize(_parent->_conjuncts.size());
611
24
    _projections.resize(_parent->_projections.size());
612
24
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
24
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
24
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
24
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
24
    return Status::OK();
627
24
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
11.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
11.3k
    _conjuncts.resize(_parent->_conjuncts.size());
611
11.3k
    _projections.resize(_parent->_projections.size());
612
11.5k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
167
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
167
    }
615
68.9k
    for (size_t i = 0; i < _projections.size(); i++) {
616
57.5k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
57.5k
    }
618
11.3k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
11.5k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
168
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
1.03k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
871
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
871
                    state, _intermediate_projections[i][j]));
624
871
        }
625
168
    }
626
11.3k
    return Status::OK();
627
11.3k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
10.0k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
10.0k
    _conjuncts.resize(_parent->_conjuncts.size());
611
10.0k
    _projections.resize(_parent->_projections.size());
612
11.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
1.15k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
1.15k
    }
615
26.7k
    for (size_t i = 0; i < _projections.size(); i++) {
616
16.6k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
16.6k
    }
618
10.0k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
10.1k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
86
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
653
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
567
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
567
                    state, _intermediate_projections[i][j]));
624
567
        }
625
86
    }
626
10.0k
    return Status::OK();
627
10.0k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
163k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
163k
    _conjuncts.resize(_parent->_conjuncts.size());
611
163k
    _projections.resize(_parent->_projections.size());
612
167k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
3.95k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
3.95k
    }
615
423k
    for (size_t i = 0; i < _projections.size(); i++) {
616
260k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
260k
    }
618
163k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
163k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
279
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
1.93k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
1.65k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
1.65k
                    state, _intermediate_projections[i][j]));
624
1.65k
        }
625
279
    }
626
163k
    return Status::OK();
627
163k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
560
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
560
    _conjuncts.resize(_parent->_conjuncts.size());
611
560
    _projections.resize(_parent->_projections.size());
612
567
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
7
    }
615
1.90k
    for (size_t i = 0; i < _projections.size(); i++) {
616
1.34k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
1.34k
    }
618
560
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
560
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
560
    return Status::OK();
627
560
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
32
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
32
    _conjuncts.resize(_parent->_conjuncts.size());
611
32
    _projections.resize(_parent->_projections.size());
612
32
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
48
    for (size_t i = 0; i < _projections.size(); i++) {
616
16
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
16
    }
618
32
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
32
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
32
    return Status::OK();
627
32
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
1.34M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
1.34M
    _conjuncts.resize(_parent->_conjuncts.size());
611
1.34M
    _projections.resize(_parent->_projections.size());
612
1.87M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
532k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
532k
    }
615
3.50M
    for (size_t i = 0; i < _projections.size(); i++) {
616
2.15M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
2.15M
    }
618
1.34M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
1.35M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
8.38k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
50.4k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
42.0k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
42.0k
                    state, _intermediate_projections[i][j]));
624
42.0k
        }
625
8.38k
    }
626
1.34M
    return Status::OK();
627
1.34M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
57.2k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
57.2k
    _conjuncts.resize(_parent->_conjuncts.size());
611
57.2k
    _projections.resize(_parent->_projections.size());
612
57.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
154k
    for (size_t i = 0; i < _projections.size(); i++) {
616
96.7k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
96.7k
    }
618
57.2k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
57.2k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
57.2k
    return Status::OK();
627
57.2k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
25
    _conjuncts.resize(_parent->_conjuncts.size());
611
25
    _projections.resize(_parent->_projections.size());
612
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
25
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
25
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
25
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
25
    return Status::OK();
627
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
10.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
10.4k
    _conjuncts.resize(_parent->_conjuncts.size());
611
10.4k
    _projections.resize(_parent->_projections.size());
612
14.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
3.57k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
3.57k
    }
615
10.4k
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
10.4k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
10.4k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
10.4k
    return Status::OK();
627
10.4k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
728
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
728
    _conjuncts.resize(_parent->_conjuncts.size());
611
728
    _projections.resize(_parent->_projections.size());
612
728
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
728
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
728
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
728
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
728
    return Status::OK();
627
728
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
5.30k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
5.30k
    _conjuncts.resize(_parent->_conjuncts.size());
611
5.30k
    _projections.resize(_parent->_projections.size());
612
5.30k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
5.47k
    for (size_t i = 0; i < _projections.size(); i++) {
616
168
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
168
    }
618
5.30k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
5.30k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
5.30k
    return Status::OK();
627
5.30k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
901k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
901k
    _conjuncts.resize(_parent->_conjuncts.size());
611
901k
    _projections.resize(_parent->_projections.size());
612
901k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
901k
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
901k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
901k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
0
                    state, _intermediate_projections[i][j]));
624
0
        }
625
0
    }
626
901k
    return Status::OK();
627
901k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
164
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
164
    _conjuncts.resize(_parent->_conjuncts.size());
611
164
    _projections.resize(_parent->_projections.size());
612
171
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
7
    }
615
483
    for (size_t i = 0; i < _projections.size(); i++) {
616
319
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
319
    }
618
164
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
167
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
3
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
11
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
8
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
8
                    state, _intermediate_projections[i][j]));
624
8
        }
625
3
    }
626
164
    return Status::OK();
627
164
}
628
629
template <typename SharedStateArg>
630
7.86k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
7.86k
    if (_terminated) {
632
1
        return Status::OK();
633
1
    }
634
7.86k
    _terminated = true;
635
7.86k
    return Status::OK();
636
7.86k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
386
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
386
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
386
    _terminated = true;
635
386
    return Status::OK();
636
386
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
34
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
34
    if (_terminated) {
632
1
        return Status::OK();
633
1
    }
634
33
    _terminated = true;
635
33
    return Status::OK();
636
34
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
68
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
68
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
68
    _terminated = true;
635
68
    return Status::OK();
636
68
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
131
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
131
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
131
    _terminated = true;
635
131
    return Status::OK();
636
131
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
6.30k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
6.30k
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
6.30k
    _terminated = true;
635
6.30k
    return Status::OK();
636
6.30k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
7
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
7
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
7
    _terminated = true;
635
7
    return Status::OK();
636
7
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
3
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
3
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
3
    _terminated = true;
635
3
    return Status::OK();
636
3
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
125
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
125
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
125
    _terminated = true;
635
125
    return Status::OK();
636
125
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
775
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
775
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
775
    _terminated = true;
635
775
    return Status::OK();
636
775
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
29
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
29
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
29
    _terminated = true;
635
29
    return Status::OK();
636
29
}
637
638
template <typename SharedStateArg>
639
3.15M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
3.15M
    if (_closed) {
641
308k
        return Status::OK();
642
308k
    }
643
2.85M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
1.50M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
1.50M
    }
646
2.85M
    _closed = true;
647
2.85M
    return Status::OK();
648
3.15M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
74.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
74.0k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
74.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
74.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
74.0k
    }
646
74.0k
    _closed = true;
647
74.0k
    return Status::OK();
648
74.0k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
4
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
4
    }
646
4
    _closed = true;
647
4
    return Status::OK();
648
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
544k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
544k
    if (_closed) {
641
272k
        return Status::OK();
642
272k
    }
643
272k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
272k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
272k
    }
646
272k
    _closed = true;
647
272k
    return Status::OK();
648
544k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
24
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
24
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
24
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
24
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
24
    }
646
24
    _closed = true;
647
24
    return Status::OK();
648
24
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
11.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
11.3k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
11.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
11.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
11.3k
    }
646
11.3k
    _closed = true;
647
11.3k
    return Status::OK();
648
11.3k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
20.1k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
20.1k
    if (_closed) {
641
10.1k
        return Status::OK();
642
10.1k
    }
643
10.0k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
10.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
10.0k
    }
646
10.0k
    _closed = true;
647
10.0k
    return Status::OK();
648
20.1k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
162k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
162k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
162k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
162k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
162k
    }
646
162k
    _closed = true;
647
162k
    return Status::OK();
648
162k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
560
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
560
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
560
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
560
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
560
    }
646
560
    _closed = true;
647
560
    return Status::OK();
648
560
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
27
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
27
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
27
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
27
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
27
    }
646
27
    _closed = true;
647
27
    return Status::OK();
648
27
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
1.36M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
1.36M
    if (_closed) {
641
19.4k
        return Status::OK();
642
19.4k
    }
643
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
    }
646
1.34M
    _closed = true;
647
1.34M
    return Status::OK();
648
1.36M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
57.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
57.3k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
57.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
57.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
57.3k
    }
646
57.3k
    _closed = true;
647
57.3k
    return Status::OK();
648
57.3k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
28
    if (_closed) {
641
14
        return Status::OK();
642
14
    }
643
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
14
    }
646
14
    _closed = true;
647
14
    return Status::OK();
648
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
10.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
10.4k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
10.4k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
10.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
10.4k
    }
646
10.4k
    _closed = true;
647
10.4k
    return Status::OK();
648
10.4k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
1.24k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
1.24k
    if (_closed) {
641
624
        return Status::OK();
642
624
    }
643
623
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
623
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
623
    }
646
623
    _closed = true;
647
623
    return Status::OK();
648
1.24k
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
10.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
10.6k
    if (_closed) {
641
5.39k
        return Status::OK();
642
5.39k
    }
643
5.29k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
5.29k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
5.29k
    }
646
5.29k
    _closed = true;
647
5.29k
    return Status::OK();
648
10.6k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
902k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
902k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
902k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
902k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
902k
    }
646
902k
    _closed = true;
647
902k
    return Status::OK();
648
902k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
327
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
327
    if (_closed) {
641
172
        return Status::OK();
642
172
    }
643
155
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
155
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
155
    }
646
155
    _closed = true;
647
155
    return Status::OK();
648
327
}
649
650
template <typename SharedState>
651
2.28M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
2.28M
    _operator_profile =
654
2.28M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
2.28M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
2.28M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
2.28M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
2.28M
    _operator_profile->add_child(_common_profile, true);
663
2.28M
    _operator_profile->add_child(_custom_profile, true);
664
665
2.28M
    _operator_profile->set_metadata(_parent->node_id());
666
2.28M
    _wait_for_finish_dependency_timer =
667
2.28M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
2.28M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
2.28M
    if constexpr (!is_fake_shared) {
670
1.52M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
1.52M
            info.shared_state_map.end()) {
672
379k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
360k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
360k
            }
675
379k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
379k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
379k
                                                  ? 0
678
379k
                                                  : info.task_idx]
679
379k
                                  .get();
680
379k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
1.14M
        } else {
682
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
18.4E
                DCHECK(false);
684
18.4E
            }
685
1.14M
            _shared_state = info.shared_state->template cast<SharedState>();
686
1.14M
            _dependency = _shared_state->create_sink_dependency(
687
1.14M
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
1.14M
        }
689
1.52M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
1.52M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
1.52M
    }
692
693
2.28M
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
2.28M
    _rows_input_counter =
698
2.28M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
2.28M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
2.28M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
2.28M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
2.28M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
2.28M
    _memory_used_counter =
704
2.28M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
2.28M
    _common_profile->add_info_string("IsColocate",
706
2.28M
                                     std::to_string(_parent->is_colocated_operator()));
707
2.28M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
2.28M
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
2.28M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
2.28M
    return Status::OK();
711
2.28M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
121k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
121k
    _operator_profile =
654
121k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
121k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
121k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
121k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
121k
    _operator_profile->add_child(_common_profile, true);
663
121k
    _operator_profile->add_child(_custom_profile, true);
664
665
121k
    _operator_profile->set_metadata(_parent->node_id());
666
121k
    _wait_for_finish_dependency_timer =
667
121k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
121k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
121k
    if constexpr (!is_fake_shared) {
670
121k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
121k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
18.6k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
18.6k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
18.6k
                                                  ? 0
678
18.6k
                                                  : info.task_idx]
679
18.6k
                                  .get();
680
18.6k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
103k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
103k
            _shared_state = info.shared_state->template cast<SharedState>();
686
103k
            _dependency = _shared_state->create_sink_dependency(
687
103k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
103k
        }
689
121k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
121k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
121k
    }
692
693
121k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
121k
    _rows_input_counter =
698
121k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
121k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
121k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
121k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
121k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
121k
    _memory_used_counter =
704
121k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
121k
    _common_profile->add_info_string("IsColocate",
706
121k
                                     std::to_string(_parent->is_colocated_operator()));
707
121k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
121k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
121k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
121k
    return Status::OK();
711
121k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
2
    _operator_profile =
654
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
2
    _operator_profile->add_child(_common_profile, true);
663
2
    _operator_profile->add_child(_custom_profile, true);
664
665
2
    _operator_profile->set_metadata(_parent->node_id());
666
2
    _wait_for_finish_dependency_timer =
667
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
2
    if constexpr (!is_fake_shared) {
670
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
2
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
2
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
2
            _shared_state = info.shared_state->template cast<SharedState>();
686
2
            _dependency = _shared_state->create_sink_dependency(
687
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
2
        }
689
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
2
    }
692
693
2
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
2
    _rows_input_counter =
698
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
2
    _memory_used_counter =
704
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
2
    _common_profile->add_info_string("IsColocate",
706
2
                                     std::to_string(_parent->is_colocated_operator()));
707
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
2
    return Status::OK();
711
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
273k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
273k
    _operator_profile =
654
273k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
273k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
273k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
273k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
273k
    _operator_profile->add_child(_common_profile, true);
663
273k
    _operator_profile->add_child(_custom_profile, true);
664
665
273k
    _operator_profile->set_metadata(_parent->node_id());
666
273k
    _wait_for_finish_dependency_timer =
667
273k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
273k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
273k
    if constexpr (!is_fake_shared) {
670
273k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
273k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
273k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
273k
            _shared_state = info.shared_state->template cast<SharedState>();
686
273k
            _dependency = _shared_state->create_sink_dependency(
687
273k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
273k
        }
689
273k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
273k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
273k
    }
692
693
273k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
273k
    _rows_input_counter =
698
273k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
273k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
273k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
273k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
273k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
273k
    _memory_used_counter =
704
273k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
273k
    _common_profile->add_info_string("IsColocate",
706
273k
                                     std::to_string(_parent->is_colocated_operator()));
707
273k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
273k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
273k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
273k
    return Status::OK();
711
273k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
31
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
31
    _operator_profile =
654
31
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
31
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
31
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
31
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
31
    _operator_profile->add_child(_common_profile, true);
663
31
    _operator_profile->add_child(_custom_profile, true);
664
665
31
    _operator_profile->set_metadata(_parent->node_id());
666
31
    _wait_for_finish_dependency_timer =
667
31
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
31
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
31
    if constexpr (!is_fake_shared) {
670
31
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
31
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
31
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
31
            _shared_state = info.shared_state->template cast<SharedState>();
686
31
            _dependency = _shared_state->create_sink_dependency(
687
31
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
31
        }
689
31
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
31
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
31
    }
692
693
31
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
31
    _rows_input_counter =
698
31
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
31
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
31
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
31
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
31
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
31
    _memory_used_counter =
704
31
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
31
    _common_profile->add_info_string("IsColocate",
706
31
                                     std::to_string(_parent->is_colocated_operator()));
707
31
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
31
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
31
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
31
    return Status::OK();
711
31
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
11.3k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
11.3k
    _operator_profile =
654
11.3k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
11.3k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
11.3k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
11.3k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
11.3k
    _operator_profile->add_child(_common_profile, true);
663
11.3k
    _operator_profile->add_child(_custom_profile, true);
664
665
11.3k
    _operator_profile->set_metadata(_parent->node_id());
666
11.3k
    _wait_for_finish_dependency_timer =
667
11.3k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
11.3k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
11.3k
    if constexpr (!is_fake_shared) {
670
11.3k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
11.3k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
11.3k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
11.3k
            _shared_state = info.shared_state->template cast<SharedState>();
686
11.3k
            _dependency = _shared_state->create_sink_dependency(
687
11.3k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
11.3k
        }
689
11.3k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
11.3k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
11.3k
    }
692
693
11.3k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
11.3k
    _rows_input_counter =
698
11.3k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
11.3k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
11.3k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
11.3k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
11.3k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
11.3k
    _memory_used_counter =
704
11.3k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
11.3k
    _common_profile->add_info_string("IsColocate",
706
11.3k
                                     std::to_string(_parent->is_colocated_operator()));
707
11.3k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
11.3k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
11.3k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
11.3k
    return Status::OK();
711
11.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
10.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
10.0k
    _operator_profile =
654
10.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
10.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
10.0k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
10.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
10.0k
    _operator_profile->add_child(_common_profile, true);
663
10.0k
    _operator_profile->add_child(_custom_profile, true);
664
665
10.0k
    _operator_profile->set_metadata(_parent->node_id());
666
10.0k
    _wait_for_finish_dependency_timer =
667
10.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
10.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
10.0k
    if constexpr (!is_fake_shared) {
670
10.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
10.0k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
10.0k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
10.0k
            _shared_state = info.shared_state->template cast<SharedState>();
686
10.0k
            _dependency = _shared_state->create_sink_dependency(
687
10.0k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
10.0k
        }
689
10.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
10.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
10.0k
    }
692
693
10.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
10.0k
    _rows_input_counter =
698
10.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
10.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
10.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
10.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
10.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
10.0k
    _memory_used_counter =
704
10.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
10.0k
    _common_profile->add_info_string("IsColocate",
706
10.0k
                                     std::to_string(_parent->is_colocated_operator()));
707
10.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
10.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
10.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
10.0k
    return Status::OK();
711
10.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
163k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
163k
    _operator_profile =
654
163k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
163k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
163k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
163k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
163k
    _operator_profile->add_child(_common_profile, true);
663
163k
    _operator_profile->add_child(_custom_profile, true);
664
665
163k
    _operator_profile->set_metadata(_parent->node_id());
666
163k
    _wait_for_finish_dependency_timer =
667
163k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
163k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
163k
    if constexpr (!is_fake_shared) {
670
163k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
163k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
163k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
163k
            _shared_state = info.shared_state->template cast<SharedState>();
686
163k
            _dependency = _shared_state->create_sink_dependency(
687
163k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
163k
        }
689
163k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
163k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
163k
    }
692
693
163k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
163k
    _rows_input_counter =
698
163k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
163k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
163k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
163k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
163k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
163k
    _memory_used_counter =
704
163k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
163k
    _common_profile->add_info_string("IsColocate",
706
163k
                                     std::to_string(_parent->is_colocated_operator()));
707
163k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
163k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
163k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
163k
    return Status::OK();
711
163k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
560
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
560
    _operator_profile =
654
560
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
560
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
560
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
560
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
560
    _operator_profile->add_child(_common_profile, true);
663
560
    _operator_profile->add_child(_custom_profile, true);
664
665
560
    _operator_profile->set_metadata(_parent->node_id());
666
560
    _wait_for_finish_dependency_timer =
667
560
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
560
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
560
    if constexpr (!is_fake_shared) {
670
560
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
561
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
561
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
561
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
561
                                                  ? 0
678
561
                                                  : info.task_idx]
679
561
                                  .get();
680
561
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
18.4E
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
686
18.4E
            _dependency = _shared_state->create_sink_dependency(
687
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
18.4E
        }
689
560
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
560
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
560
    }
692
693
560
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
560
    _rows_input_counter =
698
560
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
560
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
560
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
560
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
560
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
560
    _memory_used_counter =
704
560
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
560
    _common_profile->add_info_string("IsColocate",
706
560
                                     std::to_string(_parent->is_colocated_operator()));
707
560
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
560
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
560
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
560
    return Status::OK();
711
560
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
38
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
38
    _operator_profile =
654
38
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
38
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
38
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
38
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
38
    _operator_profile->add_child(_common_profile, true);
663
38
    _operator_profile->add_child(_custom_profile, true);
664
665
38
    _operator_profile->set_metadata(_parent->node_id());
666
38
    _wait_for_finish_dependency_timer =
667
38
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
38
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
38
    if constexpr (!is_fake_shared) {
670
38
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
38
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
38
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
38
            _shared_state = info.shared_state->template cast<SharedState>();
686
38
            _dependency = _shared_state->create_sink_dependency(
687
38
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
38
        }
689
38
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
38
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
38
    }
692
693
38
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
38
    _rows_input_counter =
698
38
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
38
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
38
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
38
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
38
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
38
    _memory_used_counter =
704
38
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
38
    _common_profile->add_info_string("IsColocate",
706
38
                                     std::to_string(_parent->is_colocated_operator()));
707
38
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
38
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
38
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
38
    return Status::OK();
711
38
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
761k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
761k
    _operator_profile =
654
761k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
761k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
761k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
761k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
761k
    _operator_profile->add_child(_common_profile, true);
663
761k
    _operator_profile->add_child(_custom_profile, true);
664
665
761k
    _operator_profile->set_metadata(_parent->node_id());
666
761k
    _wait_for_finish_dependency_timer =
667
761k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
761k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
    if constexpr (!is_fake_shared) {
670
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
                                                  ? 0
678
                                                  : info.task_idx]
679
                                  .get();
680
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
            _shared_state = info.shared_state->template cast<SharedState>();
686
            _dependency = _shared_state->create_sink_dependency(
687
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
        }
689
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
    }
692
693
761k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
761k
    _rows_input_counter =
698
761k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
761k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
761k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
761k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
761k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
761k
    _memory_used_counter =
704
761k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
761k
    _common_profile->add_info_string("IsColocate",
706
761k
                                     std::to_string(_parent->is_colocated_operator()));
707
761k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
761k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
761k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
761k
    return Status::OK();
711
761k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
7.71k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
7.71k
    _operator_profile =
654
7.71k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
7.71k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
7.71k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
7.71k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
7.71k
    _operator_profile->add_child(_common_profile, true);
663
7.71k
    _operator_profile->add_child(_custom_profile, true);
664
665
7.71k
    _operator_profile->set_metadata(_parent->node_id());
666
7.71k
    _wait_for_finish_dependency_timer =
667
7.71k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
7.71k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
7.71k
    if constexpr (!is_fake_shared) {
670
7.71k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
7.71k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
7.71k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
7.71k
            _shared_state = info.shared_state->template cast<SharedState>();
686
7.71k
            _dependency = _shared_state->create_sink_dependency(
687
7.71k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
7.71k
        }
689
7.71k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
7.71k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
7.71k
    }
692
693
7.71k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
7.71k
    _rows_input_counter =
698
7.71k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
7.71k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
7.71k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
7.71k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
7.71k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
7.71k
    _memory_used_counter =
704
7.71k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
7.71k
    _common_profile->add_info_string("IsColocate",
706
7.71k
                                     std::to_string(_parent->is_colocated_operator()));
707
7.71k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
7.71k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
7.71k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
7.71k
    return Status::OK();
711
7.71k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
726
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
726
    _operator_profile =
654
726
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
726
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
726
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
726
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
726
    _operator_profile->add_child(_common_profile, true);
663
726
    _operator_profile->add_child(_custom_profile, true);
664
665
726
    _operator_profile->set_metadata(_parent->node_id());
666
726
    _wait_for_finish_dependency_timer =
667
726
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
726
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
726
    if constexpr (!is_fake_shared) {
670
726
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
726
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
726
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
726
            _shared_state = info.shared_state->template cast<SharedState>();
686
726
            _dependency = _shared_state->create_sink_dependency(
687
726
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
726
        }
689
726
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
726
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
726
    }
692
693
726
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
726
    _rows_input_counter =
698
726
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
726
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
726
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
726
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
726
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
726
    _memory_used_counter =
704
726
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
726
    _common_profile->add_info_string("IsColocate",
706
726
                                     std::to_string(_parent->is_colocated_operator()));
707
726
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
726
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
726
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
726
    return Status::OK();
711
726
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
3.70k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
3.70k
    _operator_profile =
654
3.70k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
3.70k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
3.70k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
3.70k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
3.70k
    _operator_profile->add_child(_common_profile, true);
663
3.70k
    _operator_profile->add_child(_custom_profile, true);
664
665
3.70k
    _operator_profile->set_metadata(_parent->node_id());
666
3.70k
    _wait_for_finish_dependency_timer =
667
3.70k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
3.70k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
3.70k
    if constexpr (!is_fake_shared) {
670
3.70k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
3.70k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
3.70k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
3.70k
            _shared_state = info.shared_state->template cast<SharedState>();
686
3.70k
            _dependency = _shared_state->create_sink_dependency(
687
3.70k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
3.70k
        }
689
3.70k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
3.70k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
3.70k
    }
692
693
3.70k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
3.70k
    _rows_input_counter =
698
3.70k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
3.70k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
3.70k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
3.70k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
3.70k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
3.70k
    _memory_used_counter =
704
3.70k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
3.70k
    _common_profile->add_info_string("IsColocate",
706
3.70k
                                     std::to_string(_parent->is_colocated_operator()));
707
3.70k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
3.70k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
3.70k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
3.70k
    return Status::OK();
711
3.70k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
12.8k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
12.8k
    _operator_profile =
654
12.8k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
12.8k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
12.8k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
12.8k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
12.8k
    _operator_profile->add_child(_common_profile, true);
663
12.8k
    _operator_profile->add_child(_custom_profile, true);
664
665
12.8k
    _operator_profile->set_metadata(_parent->node_id());
666
12.8k
    _wait_for_finish_dependency_timer =
667
12.8k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
12.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
12.8k
    if constexpr (!is_fake_shared) {
670
12.8k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
12.8k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
12.8k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
12.8k
            _shared_state = info.shared_state->template cast<SharedState>();
686
12.8k
            _dependency = _shared_state->create_sink_dependency(
687
12.8k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
12.8k
        }
689
12.8k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
12.8k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
12.8k
    }
692
693
12.8k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
12.8k
    _rows_input_counter =
698
12.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
12.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
12.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
12.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
12.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
12.8k
    _memory_used_counter =
704
12.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
12.8k
    _common_profile->add_info_string("IsColocate",
706
12.8k
                                     std::to_string(_parent->is_colocated_operator()));
707
12.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
12.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
12.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
12.8k
    return Status::OK();
711
12.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
359k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
359k
    _operator_profile =
654
359k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
359k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
359k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
359k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
359k
    _operator_profile->add_child(_common_profile, true);
663
359k
    _operator_profile->add_child(_custom_profile, true);
664
665
359k
    _operator_profile->set_metadata(_parent->node_id());
666
359k
    _wait_for_finish_dependency_timer =
667
359k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
359k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
359k
    if constexpr (!is_fake_shared) {
670
359k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
360k
            info.shared_state_map.end()) {
672
360k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
360k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
360k
            }
675
360k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
360k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
360k
                                                  ? 0
678
360k
                                                  : info.task_idx]
679
360k
                                  .get();
680
360k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
18.4E
        } else {
682
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
18.4E
                DCHECK(false);
684
18.4E
            }
685
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
686
18.4E
            _dependency = _shared_state->create_sink_dependency(
687
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
18.4E
        }
689
359k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
359k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
359k
    }
692
693
359k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
359k
    _rows_input_counter =
698
359k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
359k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
359k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
359k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
359k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
359k
    _memory_used_counter =
704
359k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
359k
    _common_profile->add_info_string("IsColocate",
706
359k
                                     std::to_string(_parent->is_colocated_operator()));
707
359k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
359k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
359k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
359k
    return Status::OK();
711
359k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
557k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
557k
    _operator_profile =
654
557k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
557k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
557k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
557k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
557k
    _operator_profile->add_child(_common_profile, true);
663
557k
    _operator_profile->add_child(_custom_profile, true);
664
665
557k
    _operator_profile->set_metadata(_parent->node_id());
666
557k
    _wait_for_finish_dependency_timer =
667
557k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
557k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
557k
    if constexpr (!is_fake_shared) {
670
557k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
557k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
557k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
557k
            _shared_state = info.shared_state->template cast<SharedState>();
686
557k
            _dependency = _shared_state->create_sink_dependency(
687
557k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
557k
        }
689
557k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
557k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
557k
    }
692
693
557k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
557k
    _rows_input_counter =
698
557k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
557k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
557k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
557k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
557k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
557k
    _memory_used_counter =
704
557k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
557k
    _common_profile->add_info_string("IsColocate",
706
557k
                                     std::to_string(_parent->is_colocated_operator()));
707
557k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
557k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
557k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
557k
    return Status::OK();
711
557k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
25
    _operator_profile =
654
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
25
    _operator_profile->add_child(_common_profile, true);
663
25
    _operator_profile->add_child(_custom_profile, true);
664
665
25
    _operator_profile->set_metadata(_parent->node_id());
666
25
    _wait_for_finish_dependency_timer =
667
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
25
    if constexpr (!is_fake_shared) {
670
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
25
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
25
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
25
            _shared_state = info.shared_state->template cast<SharedState>();
686
25
            _dependency = _shared_state->create_sink_dependency(
687
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
25
        }
689
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
25
    }
692
693
25
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
25
    _rows_input_counter =
698
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
25
    _memory_used_counter =
704
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
25
    _common_profile->add_info_string("IsColocate",
706
25
                                     std::to_string(_parent->is_colocated_operator()));
707
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
25
    return Status::OK();
711
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
328
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
328
    _operator_profile =
654
328
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
328
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
328
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
328
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
328
    _operator_profile->add_child(_common_profile, true);
663
328
    _operator_profile->add_child(_custom_profile, true);
664
665
328
    _operator_profile->set_metadata(_parent->node_id());
666
328
    _wait_for_finish_dependency_timer =
667
328
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
328
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
328
    if constexpr (!is_fake_shared) {
670
328
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
328
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
328
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
328
            _shared_state = info.shared_state->template cast<SharedState>();
686
328
            _dependency = _shared_state->create_sink_dependency(
687
328
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
328
        }
689
328
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
328
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
328
    }
692
693
328
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
328
    _rows_input_counter =
698
328
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
328
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
328
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
328
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
328
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
328
    _memory_used_counter =
704
328
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
328
    _common_profile->add_info_string("IsColocate",
706
328
                                     std::to_string(_parent->is_colocated_operator()));
707
328
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
328
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
328
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
328
    return Status::OK();
711
328
}
712
713
template <typename SharedState>
714
2.29M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
2.29M
    if (_closed) {
716
2
        return Status::OK();
717
2
    }
718
2.29M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
1.52M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
1.52M
    }
721
2.29M
    _closed = true;
722
2.29M
    return Status::OK();
723
2.29M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
122k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
122k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
122k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
122k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
122k
    }
721
122k
    _closed = true;
722
122k
    return Status::OK();
723
122k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
1
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
1
    }
721
1
    _closed = true;
722
1
    return Status::OK();
723
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
273k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
273k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
273k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
273k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
273k
    }
721
273k
    _closed = true;
722
273k
    return Status::OK();
723
273k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
22
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
22
    if (_closed) {
716
2
        return Status::OK();
717
2
    }
718
20
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
20
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
20
    }
721
20
    _closed = true;
722
20
    return Status::OK();
723
22
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
11.3k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
11.3k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
11.3k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
11.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
11.3k
    }
721
11.3k
    _closed = true;
722
11.3k
    return Status::OK();
723
11.3k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
10.0k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
10.0k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
10.0k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
10.0k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
10.0k
    }
721
10.0k
    _closed = true;
722
10.0k
    return Status::OK();
723
10.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
162k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
162k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
162k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
162k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
162k
    }
721
162k
    _closed = true;
722
162k
    return Status::OK();
723
162k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
560
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
560
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
560
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
560
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
560
    }
721
560
    _closed = true;
722
560
    return Status::OK();
723
560
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
27
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
27
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
27
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
27
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
27
    }
721
27
    _closed = true;
722
27
    return Status::OK();
723
27
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
765k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
765k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
    }
721
765k
    _closed = true;
722
765k
    return Status::OK();
723
765k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
7.71k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
7.71k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
7.71k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
7.71k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
7.71k
    }
721
7.71k
    _closed = true;
722
7.71k
    return Status::OK();
723
7.71k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
624
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
624
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
624
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
624
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
624
    }
721
624
    _closed = true;
722
624
    return Status::OK();
723
624
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
3.70k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
3.70k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
3.70k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
3.70k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
3.70k
    }
721
3.70k
    _closed = true;
722
3.70k
    return Status::OK();
723
3.70k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
12.8k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
12.8k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
12.8k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
12.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
12.8k
    }
721
12.8k
    _closed = true;
722
12.8k
    return Status::OK();
723
12.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
360k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
360k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
360k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
360k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
360k
    }
721
360k
    _closed = true;
722
360k
    return Status::OK();
723
360k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
561k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
561k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
561k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
561k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
561k
    }
721
561k
    _closed = true;
722
561k
    return Status::OK();
723
561k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
14
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
14
    }
721
14
    _closed = true;
722
14
    return Status::OK();
723
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
328
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
328
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
328
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
328
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
328
    }
721
328
    _closed = true;
722
328
    return Status::OK();
723
328
}
724
725
template <typename LocalStateType>
726
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
727
11.5k
                                                          bool* eos) {
728
11.5k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
11.5k
    return pull(state, block, eos);
730
11.5k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
727
431
                                                          bool* eos) {
728
431
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
431
    return pull(state, block, eos);
730
431
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
727
11.0k
                                                          bool* eos) {
728
11.0k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
11.0k
    return pull(state, block, eos);
730
11.0k
}
731
732
template <typename LocalStateType>
733
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
734
792k
                                                         bool* eos) {
735
792k
    auto& local_state = get_local_state(state);
736
792k
    if (need_more_input_data(state)) {
737
764k
        local_state._child_block->clear_column_data(
738
764k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
764k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
764k
                state, local_state._child_block.get(), &local_state._child_eos));
741
764k
        *eos = local_state._child_eos;
742
764k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
59.3k
            return Status::OK();
744
59.3k
        }
745
705k
        {
746
705k
            SCOPED_TIMER(local_state.exec_time_counter());
747
705k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
705k
        }
749
705k
    }
750
751
733k
    if (!need_more_input_data(state)) {
752
681k
        SCOPED_TIMER(local_state.exec_time_counter());
753
681k
        bool new_eos = false;
754
681k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
681k
        if (new_eos) {
756
598k
            *eos = true;
757
598k
        } else if (!need_more_input_data(state)) {
758
24.0k
            *eos = false;
759
24.0k
        }
760
681k
    }
761
733k
    return Status::OK();
762
733k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
143k
                                                         bool* eos) {
735
143k
    auto& local_state = get_local_state(state);
736
143k
    if (need_more_input_data(state)) {
737
125k
        local_state._child_block->clear_column_data(
738
125k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
125k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
125k
                state, local_state._child_block.get(), &local_state._child_eos));
741
125k
        *eos = local_state._child_eos;
742
125k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
34.8k
            return Status::OK();
744
34.8k
        }
745
90.9k
        {
746
90.9k
            SCOPED_TIMER(local_state.exec_time_counter());
747
90.9k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
90.9k
        }
749
90.9k
    }
750
751
108k
    if (!need_more_input_data(state)) {
752
108k
        SCOPED_TIMER(local_state.exec_time_counter());
753
108k
        bool new_eos = false;
754
108k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
108k
        if (new_eos) {
756
49.8k
            *eos = true;
757
58.6k
        } else if (!need_more_input_data(state)) {
758
10.7k
            *eos = false;
759
10.7k
        }
760
108k
    }
761
108k
    return Status::OK();
762
108k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
4.15k
                                                         bool* eos) {
735
4.15k
    auto& local_state = get_local_state(state);
736
4.15k
    if (need_more_input_data(state)) {
737
2.37k
        local_state._child_block->clear_column_data(
738
2.37k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
2.37k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
2.37k
                state, local_state._child_block.get(), &local_state._child_eos));
741
2.37k
        *eos = local_state._child_eos;
742
2.37k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
428
            return Status::OK();
744
428
        }
745
1.95k
        {
746
1.95k
            SCOPED_TIMER(local_state.exec_time_counter());
747
1.95k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
1.95k
        }
749
1.95k
    }
750
751
3.73k
    if (!need_more_input_data(state)) {
752
3.73k
        SCOPED_TIMER(local_state.exec_time_counter());
753
3.73k
        bool new_eos = false;
754
3.73k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
3.73k
        if (new_eos) {
756
1.39k
            *eos = true;
757
2.34k
        } else if (!need_more_input_data(state)) {
758
1.77k
            *eos = false;
759
1.77k
        }
760
3.73k
    }
761
3.72k
    return Status::OK();
762
3.72k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
4.94k
                                                         bool* eos) {
735
4.94k
    auto& local_state = get_local_state(state);
736
4.94k
    if (need_more_input_data(state)) {
737
4.94k
        local_state._child_block->clear_column_data(
738
4.94k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
4.94k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
4.94k
                state, local_state._child_block.get(), &local_state._child_eos));
741
4.94k
        *eos = local_state._child_eos;
742
4.94k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
1.73k
            return Status::OK();
744
1.73k
        }
745
3.21k
        {
746
3.21k
            SCOPED_TIMER(local_state.exec_time_counter());
747
3.21k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
3.21k
        }
749
3.21k
    }
750
751
3.21k
    if (!need_more_input_data(state)) {
752
3.21k
        SCOPED_TIMER(local_state.exec_time_counter());
753
3.21k
        bool new_eos = false;
754
3.21k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
3.21k
        if (new_eos) {
756
1.74k
            *eos = true;
757
1.74k
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
3.21k
    }
761
3.21k
    return Status::OK();
762
3.21k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
37.9k
                                                         bool* eos) {
735
37.9k
    auto& local_state = get_local_state(state);
736
38.0k
    if (need_more_input_data(state)) {
737
38.0k
        local_state._child_block->clear_column_data(
738
38.0k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
38.0k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
38.0k
                state, local_state._child_block.get(), &local_state._child_eos));
741
38.0k
        *eos = local_state._child_eos;
742
38.0k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
5.66k
            return Status::OK();
744
5.66k
        }
745
32.3k
        {
746
32.3k
            SCOPED_TIMER(local_state.exec_time_counter());
747
32.3k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
32.3k
        }
749
32.3k
    }
750
751
32.2k
    if (!need_more_input_data(state)) {
752
12.6k
        SCOPED_TIMER(local_state.exec_time_counter());
753
12.6k
        bool new_eos = false;
754
12.6k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
12.6k
        if (new_eos) {
756
12.5k
            *eos = true;
757
12.5k
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
12.6k
    }
761
32.2k
    return Status::OK();
762
32.2k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
563k
                                                         bool* eos) {
735
563k
    auto& local_state = get_local_state(state);
736
565k
    if (need_more_input_data(state)) {
737
565k
        local_state._child_block->clear_column_data(
738
565k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
565k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
565k
                state, local_state._child_block.get(), &local_state._child_eos));
741
565k
        *eos = local_state._child_eos;
742
565k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
13.4k
            return Status::OK();
744
13.4k
        }
745
552k
        {
746
552k
            SCOPED_TIMER(local_state.exec_time_counter());
747
552k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
552k
        }
749
552k
    }
750
751
550k
    if (!need_more_input_data(state)) {
752
518k
        SCOPED_TIMER(local_state.exec_time_counter());
753
518k
        bool new_eos = false;
754
518k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
518k
        if (new_eos) {
756
517k
            *eos = true;
757
517k
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
518k
    }
761
550k
    return Status::OK();
762
550k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
32.1k
                                                         bool* eos) {
735
32.1k
    auto& local_state = get_local_state(state);
736
32.1k
    if (need_more_input_data(state)) {
737
21.0k
        local_state._child_block->clear_column_data(
738
21.0k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
21.0k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
21.0k
                state, local_state._child_block.get(), &local_state._child_eos));
741
21.0k
        *eos = local_state._child_eos;
742
21.0k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
2.46k
            return Status::OK();
744
2.46k
        }
745
18.5k
        {
746
18.5k
            SCOPED_TIMER(local_state.exec_time_counter());
747
18.5k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
18.5k
        }
749
18.5k
    }
750
751
29.6k
    if (!need_more_input_data(state)) {
752
28.9k
        SCOPED_TIMER(local_state.exec_time_counter());
753
28.9k
        bool new_eos = false;
754
28.9k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
28.9k
        if (new_eos) {
756
11.3k
            *eos = true;
757
17.6k
        } else if (!need_more_input_data(state)) {
758
11.1k
            *eos = false;
759
11.1k
        }
760
28.9k
    }
761
29.6k
    return Status::OK();
762
29.6k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
7.05k
                                                         bool* eos) {
735
7.05k
    auto& local_state = get_local_state(state);
736
7.05k
    if (need_more_input_data(state)) {
737
6.71k
        local_state._child_block->clear_column_data(
738
6.71k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
6.71k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
6.71k
                state, local_state._child_block.get(), &local_state._child_eos));
741
6.71k
        *eos = local_state._child_eos;
742
6.71k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
824
            return Status::OK();
744
824
        }
745
5.88k
        {
746
5.88k
            SCOPED_TIMER(local_state.exec_time_counter());
747
5.88k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
5.88k
        }
749
5.88k
    }
750
751
6.24k
    if (!need_more_input_data(state)) {
752
6.24k
        SCOPED_TIMER(local_state.exec_time_counter());
753
6.24k
        bool new_eos = false;
754
6.24k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
6.24k
        if (new_eos) {
756
4.12k
            *eos = true;
757
4.12k
        } else if (!need_more_input_data(state)) {
758
366
            *eos = false;
759
366
        }
760
6.24k
    }
761
6.22k
    return Status::OK();
762
6.22k
}
763
764
template <typename Writer, typename Parent>
765
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
766
68.8k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
68.8k
    RETURN_IF_ERROR(Base::init(state, info));
768
68.8k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
68.8k
                                                         "AsyncWriterDependency", true);
770
68.8k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
68.8k
                             _finish_dependency));
772
773
68.8k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
68.8k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
68.8k
    return Status::OK();
776
68.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
525
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
525
    RETURN_IF_ERROR(Base::init(state, info));
768
525
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
525
                                                         "AsyncWriterDependency", true);
770
525
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
525
                             _finish_dependency));
772
773
525
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
525
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
525
    return Status::OK();
776
525
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
86
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
86
    RETURN_IF_ERROR(Base::init(state, info));
768
86
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
86
                                                         "AsyncWriterDependency", true);
770
86
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
86
                             _finish_dependency));
772
773
86
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
86
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
86
    return Status::OK();
776
86
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
46.6k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
46.6k
    RETURN_IF_ERROR(Base::init(state, info));
768
46.6k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
46.6k
                                                         "AsyncWriterDependency", true);
770
46.6k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
46.6k
                             _finish_dependency));
772
773
46.6k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
46.6k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
46.6k
    return Status::OK();
776
46.6k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
9.63k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
9.63k
    RETURN_IF_ERROR(Base::init(state, info));
768
9.63k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
9.63k
                                                         "AsyncWriterDependency", true);
770
9.63k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
9.63k
                             _finish_dependency));
772
773
9.63k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
9.63k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
9.63k
    return Status::OK();
776
9.63k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
5.23k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
5.23k
    RETURN_IF_ERROR(Base::init(state, info));
768
5.23k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
5.23k
                                                         "AsyncWriterDependency", true);
770
5.23k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
5.23k
                             _finish_dependency));
772
773
5.23k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
5.23k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
5.23k
    return Status::OK();
776
5.23k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
4.04k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
4.04k
    RETURN_IF_ERROR(Base::init(state, info));
768
4.04k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
4.04k
                                                         "AsyncWriterDependency", true);
770
4.04k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
4.04k
                             _finish_dependency));
772
773
4.04k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
4.04k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
4.04k
    return Status::OK();
776
4.04k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
48
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
48
    RETURN_IF_ERROR(Base::init(state, info));
768
48
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
48
                                                         "AsyncWriterDependency", true);
770
48
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
48
                             _finish_dependency));
772
773
48
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
48
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
48
    return Status::OK();
776
48
}
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
704
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
704
    RETURN_IF_ERROR(Base::init(state, info));
768
704
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
704
                                                         "AsyncWriterDependency", true);
770
704
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
704
                             _finish_dependency));
772
773
704
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
704
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
704
    return Status::OK();
776
704
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
1.77k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
1.77k
    RETURN_IF_ERROR(Base::init(state, info));
768
1.77k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
1.77k
                                                         "AsyncWriterDependency", true);
770
1.77k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
1.77k
                             _finish_dependency));
772
773
1.77k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
1.77k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
1.77k
    return Status::OK();
776
1.77k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
156
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
156
    RETURN_IF_ERROR(Base::init(state, info));
768
156
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
156
                                                         "AsyncWriterDependency", true);
770
156
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
156
                             _finish_dependency));
772
773
156
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
156
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
156
    return Status::OK();
776
156
}
777
778
template <typename Writer, typename Parent>
779
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
780
68.8k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
68.8k
    RETURN_IF_ERROR(Base::open(state));
782
68.8k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
605k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
536k
        RETURN_IF_ERROR(
785
536k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
536k
    }
787
68.8k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
68.8k
    return Status::OK();
789
68.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
525
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
525
    RETURN_IF_ERROR(Base::open(state));
782
525
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
2.90k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
2.38k
        RETURN_IF_ERROR(
785
2.38k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
2.38k
    }
787
525
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
525
    return Status::OK();
789
525
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
86
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
86
    RETURN_IF_ERROR(Base::open(state));
782
86
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
402
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
316
        RETURN_IF_ERROR(
785
316
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
316
    }
787
86
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
86
    return Status::OK();
789
86
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
46.9k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
46.9k
    RETURN_IF_ERROR(Base::open(state));
782
46.9k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
344k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
297k
        RETURN_IF_ERROR(
785
297k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
297k
    }
787
46.9k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
46.9k
    return Status::OK();
789
46.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
9.39k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
9.39k
    RETURN_IF_ERROR(Base::open(state));
782
9.39k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
57.2k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
47.8k
        RETURN_IF_ERROR(
785
47.8k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
47.8k
    }
787
9.39k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
9.39k
    return Status::OK();
789
9.39k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
5.22k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
5.22k
    RETURN_IF_ERROR(Base::open(state));
782
5.22k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
136k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
131k
        RETURN_IF_ERROR(
785
131k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
131k
    }
787
5.22k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
5.22k
    return Status::OK();
789
5.22k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
4.04k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
4.04k
    RETURN_IF_ERROR(Base::open(state));
782
4.04k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
45.8k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
41.7k
        RETURN_IF_ERROR(
785
41.7k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
41.7k
    }
787
4.04k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
4.04k
    return Status::OK();
789
4.04k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
48
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
48
    RETURN_IF_ERROR(Base::open(state));
782
48
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
206
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
158
        RETURN_IF_ERROR(
785
158
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
158
    }
787
48
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
48
    return Status::OK();
789
48
}
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
702
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
702
    RETURN_IF_ERROR(Base::open(state));
782
702
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
2.09k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
1.38k
        RETURN_IF_ERROR(
785
1.38k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
1.38k
    }
787
702
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
702
    return Status::OK();
789
702
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
1.76k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
1.76k
    RETURN_IF_ERROR(Base::open(state));
782
1.76k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
14.7k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
13.0k
        RETURN_IF_ERROR(
785
13.0k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
13.0k
    }
787
1.76k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
1.76k
    return Status::OK();
789
1.76k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
156
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
156
    RETURN_IF_ERROR(Base::open(state));
782
156
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
786
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
630
        RETURN_IF_ERROR(
785
630
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
630
    }
787
156
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
156
    return Status::OK();
789
156
}
790
791
template <typename Writer, typename Parent>
792
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
793
94.8k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
94.8k
    return _writer->sink(block, eos);
795
94.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
2.35k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
2.35k
    return _writer->sink(block, eos);
795
2.35k
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
110
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
110
    return _writer->sink(block, eos);
795
110
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
63.7k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
63.7k
    return _writer->sink(block, eos);
795
63.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
11.0k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
11.0k
    return _writer->sink(block, eos);
795
11.0k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
7.66k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
7.66k
    return _writer->sink(block, eos);
795
7.66k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
6.59k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
6.59k
    return _writer->sink(block, eos);
795
6.59k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
58
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
58
    return _writer->sink(block, eos);
795
58
}
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
794
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
794
    return _writer->sink(block, eos);
795
794
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
2.23k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
2.23k
    return _writer->sink(block, eos);
795
2.23k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
310
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
310
    return _writer->sink(block, eos);
795
310
}
796
797
template <typename Writer, typename Parent>
798
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
799
69.0k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
69.0k
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
69.0k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
69.0k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
69.1k
    if (_writer) {
807
69.1k
        Status st = _writer->get_writer_status();
808
69.1k
        if (exec_status.ok()) {
809
69.0k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
69.0k
                                                       : Status::Cancelled("force close"));
811
69.0k
        } else {
812
157
            _writer->force_close(exec_status);
813
157
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
69.1k
        RETURN_IF_ERROR(st);
818
69.1k
    }
819
68.9k
    return Base::close(state, exec_status);
820
69.0k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
513
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
513
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
513
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
513
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
513
    if (_writer) {
807
513
        Status st = _writer->get_writer_status();
808
513
        if (exec_status.ok()) {
809
513
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
513
                                                       : Status::Cancelled("force close"));
811
513
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
513
        RETURN_IF_ERROR(st);
818
513
    }
819
513
    return Base::close(state, exec_status);
820
513
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
86
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
86
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
86
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
86
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
86
    if (_writer) {
807
86
        Status st = _writer->get_writer_status();
808
86
        if (exec_status.ok()) {
809
86
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
86
                                                       : Status::Cancelled("force close"));
811
86
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
86
        RETURN_IF_ERROR(st);
818
86
    }
819
78
    return Base::close(state, exec_status);
820
86
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
46.9k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
46.9k
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
46.9k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
46.9k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
46.9k
    if (_writer) {
807
46.9k
        Status st = _writer->get_writer_status();
808
46.9k
        if (exec_status.ok()) {
809
46.9k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
46.9k
                                                       : Status::Cancelled("force close"));
811
46.9k
        } else {
812
43
            _writer->force_close(exec_status);
813
43
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
46.9k
        RETURN_IF_ERROR(st);
818
46.9k
    }
819
46.8k
    return Base::close(state, exec_status);
820
46.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
9.56k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
9.56k
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
9.56k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
9.56k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
9.61k
    if (_writer) {
807
9.61k
        Status st = _writer->get_writer_status();
808
9.61k
        if (exec_status.ok()) {
809
9.50k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
9.50k
                                                       : Status::Cancelled("force close"));
811
9.50k
        } else {
812
114
            _writer->force_close(exec_status);
813
114
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
9.61k
        RETURN_IF_ERROR(st);
818
9.61k
    }
819
9.56k
    return Base::close(state, exec_status);
820
9.56k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
5.23k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
5.23k
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
5.23k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
5.23k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
5.23k
    if (_writer) {
807
5.23k
        Status st = _writer->get_writer_status();
808
5.23k
        if (exec_status.ok()) {
809
5.23k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
5.23k
                                                       : Status::Cancelled("force close"));
811
5.23k
        } else {
812
2
            _writer->force_close(exec_status);
813
2
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
5.23k
        RETURN_IF_ERROR(st);
818
5.23k
    }
819
5.23k
    return Base::close(state, exec_status);
820
5.23k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
4.03k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
4.03k
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
4.03k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
4.03k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
4.04k
    if (_writer) {
807
4.04k
        Status st = _writer->get_writer_status();
808
4.04k
        if (exec_status.ok()) {
809
4.04k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
4.04k
                                                       : Status::Cancelled("force close"));
811
18.4E
        } else {
812
18.4E
            _writer->force_close(exec_status);
813
18.4E
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
4.04k
        RETURN_IF_ERROR(st);
818
4.04k
    }
819
4.03k
    return Base::close(state, exec_status);
820
4.03k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
48
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
48
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
48
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
48
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
48
    if (_writer) {
807
48
        Status st = _writer->get_writer_status();
808
48
        if (exec_status.ok()) {
809
48
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
48
                                                       : Status::Cancelled("force close"));
811
48
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
48
        RETURN_IF_ERROR(st);
818
48
    }
819
48
    return Base::close(state, exec_status);
820
48
}
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
702
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
702
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
702
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
702
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
704
    if (_writer) {
807
704
        Status st = _writer->get_writer_status();
808
704
        if (exec_status.ok()) {
809
704
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
704
                                                       : Status::Cancelled("force close"));
811
704
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
704
        RETURN_IF_ERROR(st);
818
704
    }
819
702
    return Base::close(state, exec_status);
820
702
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
1.77k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
1.77k
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
1.77k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
1.77k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
1.77k
    if (_writer) {
807
1.77k
        Status st = _writer->get_writer_status();
808
1.77k
        if (exec_status.ok()) {
809
1.77k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
1.77k
                                                       : Status::Cancelled("force close"));
811
1.77k
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
1.77k
        RETURN_IF_ERROR(st);
818
1.77k
    }
819
1.77k
    return Base::close(state, exec_status);
820
1.77k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
156
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
156
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
156
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
156
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
805
    // if the init failed, the _writer may be nullptr. so here need check
806
156
    if (_writer) {
807
156
        Status st = _writer->get_writer_status();
808
156
        if (exec_status.ok()) {
809
156
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
156
                                                       : Status::Cancelled("force close"));
811
156
        } else {
812
0
            _writer->force_close(exec_status);
813
0
        }
814
        // If there is an error in process_block thread, then we should get the writer
815
        // status before call force_close. For example, the thread may failed in commit
816
        // transaction.
817
156
        RETURN_IF_ERROR(st);
818
156
    }
819
156
    return Base::close(state, exec_status);
820
156
}
821
822
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
823
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
824
DECLARE_OPERATOR(ResultSinkLocalState)
825
DECLARE_OPERATOR(JdbcTableSinkLocalState)
826
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
827
DECLARE_OPERATOR(ResultFileSinkLocalState)
828
DECLARE_OPERATOR(OlapTableSinkLocalState)
829
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
830
DECLARE_OPERATOR(HiveTableSinkLocalState)
831
DECLARE_OPERATOR(TVFTableSinkLocalState)
832
DECLARE_OPERATOR(IcebergTableSinkLocalState)
833
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
834
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
835
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
836
DECLARE_OPERATOR(MCTableSinkLocalState)
837
DECLARE_OPERATOR(AnalyticSinkLocalState)
838
DECLARE_OPERATOR(BlackholeSinkLocalState)
839
DECLARE_OPERATOR(SortSinkLocalState)
840
DECLARE_OPERATOR(SpillSortSinkLocalState)
841
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
842
DECLARE_OPERATOR(AggSinkLocalState)
843
DECLARE_OPERATOR(BucketedAggSinkLocalState)
844
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
845
DECLARE_OPERATOR(ExchangeSinkLocalState)
846
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
847
DECLARE_OPERATOR(UnionSinkLocalState)
848
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
849
DECLARE_OPERATOR(PartitionSortSinkLocalState)
850
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
851
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
852
DECLARE_OPERATOR(SetSinkLocalState<true>)
853
DECLARE_OPERATOR(SetSinkLocalState<false>)
854
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
855
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
856
DECLARE_OPERATOR(CacheSinkLocalState)
857
DECLARE_OPERATOR(DictSinkLocalState)
858
DECLARE_OPERATOR(RecCTESinkLocalState)
859
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
860
861
#undef DECLARE_OPERATOR
862
863
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
864
DECLARE_OPERATOR(HashJoinProbeLocalState)
865
DECLARE_OPERATOR(OlapScanLocalState)
866
DECLARE_OPERATOR(GroupCommitLocalState)
867
DECLARE_OPERATOR(JDBCScanLocalState)
868
DECLARE_OPERATOR(FileScanLocalState)
869
DECLARE_OPERATOR(AnalyticLocalState)
870
DECLARE_OPERATOR(SortLocalState)
871
DECLARE_OPERATOR(SpillSortLocalState)
872
DECLARE_OPERATOR(LocalMergeSortLocalState)
873
DECLARE_OPERATOR(AggLocalState)
874
DECLARE_OPERATOR(BucketedAggLocalState)
875
DECLARE_OPERATOR(PartitionedAggLocalState)
876
DECLARE_OPERATOR(TableFunctionLocalState)
877
DECLARE_OPERATOR(ExchangeLocalState)
878
DECLARE_OPERATOR(RepeatLocalState)
879
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
880
DECLARE_OPERATOR(AssertNumRowsLocalState)
881
DECLARE_OPERATOR(EmptySetLocalState)
882
DECLARE_OPERATOR(UnionSourceLocalState)
883
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
884
DECLARE_OPERATOR(PartitionSortSourceLocalState)
885
DECLARE_OPERATOR(SetSourceLocalState<true>)
886
DECLARE_OPERATOR(SetSourceLocalState<false>)
887
DECLARE_OPERATOR(DataGenLocalState)
888
DECLARE_OPERATOR(SchemaScanLocalState)
889
DECLARE_OPERATOR(MetaScanLocalState)
890
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
891
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
892
DECLARE_OPERATOR(CacheSourceLocalState)
893
DECLARE_OPERATOR(RecCTESourceLocalState)
894
DECLARE_OPERATOR(RecCTEScanLocalState)
895
896
#ifdef BE_TEST
897
DECLARE_OPERATOR(MockLocalState)
898
DECLARE_OPERATOR(MockScanLocalState)
899
#endif
900
#undef DECLARE_OPERATOR
901
902
template class StreamingOperatorX<AssertNumRowsLocalState>;
903
template class StreamingOperatorX<SelectLocalState>;
904
905
template class StatefulOperatorX<HashJoinProbeLocalState>;
906
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
907
template class StatefulOperatorX<RepeatLocalState>;
908
template class StatefulOperatorX<MaterializationLocalState>;
909
template class StatefulOperatorX<StreamingAggLocalState>;
910
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
911
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
912
template class StatefulOperatorX<TableFunctionLocalState>;
913
914
template class PipelineXSinkLocalState<HashJoinSharedState>;
915
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
916
template class PipelineXSinkLocalState<SortSharedState>;
917
template class PipelineXSinkLocalState<SpillSortSharedState>;
918
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
919
template class PipelineXSinkLocalState<AnalyticSharedState>;
920
template class PipelineXSinkLocalState<AggSharedState>;
921
template class PipelineXSinkLocalState<BucketedAggSharedState>;
922
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
923
template class PipelineXSinkLocalState<FakeSharedState>;
924
template class PipelineXSinkLocalState<UnionSharedState>;
925
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
926
template class PipelineXSinkLocalState<MultiCastSharedState>;
927
template class PipelineXSinkLocalState<SetSharedState>;
928
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
929
template class PipelineXSinkLocalState<BasicSharedState>;
930
template class PipelineXSinkLocalState<DataQueueSharedState>;
931
template class PipelineXSinkLocalState<RecCTESharedState>;
932
933
template class PipelineXLocalState<HashJoinSharedState>;
934
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
935
template class PipelineXLocalState<SortSharedState>;
936
template class PipelineXLocalState<SpillSortSharedState>;
937
template class PipelineXLocalState<NestedLoopJoinSharedState>;
938
template class PipelineXLocalState<AnalyticSharedState>;
939
template class PipelineXLocalState<AggSharedState>;
940
template class PipelineXLocalState<BucketedAggSharedState>;
941
template class PipelineXLocalState<PartitionedAggSharedState>;
942
template class PipelineXLocalState<FakeSharedState>;
943
template class PipelineXLocalState<UnionSharedState>;
944
template class PipelineXLocalState<DataQueueSharedState>;
945
template class PipelineXLocalState<MultiCastSharedState>;
946
template class PipelineXLocalState<PartitionSortNodeSharedState>;
947
template class PipelineXLocalState<SetSharedState>;
948
template class PipelineXLocalState<LocalExchangeSharedState>;
949
template class PipelineXLocalState<BasicSharedState>;
950
template class PipelineXLocalState<RecCTESharedState>;
951
952
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
953
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
954
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
955
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
956
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
957
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
958
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
959
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
960
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
961
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
962
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
963
964
#ifdef BE_TEST
965
template class OperatorX<DummyOperatorLocalState>;
966
template class DataSinkOperatorX<DummySinkLocalState>;
967
#endif
968
969
} // namespace doris