Coverage Report

Created: 2026-04-13 03:36

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 "common/status.h"
21
#include "exec/common/util.hpp"
22
#include "exec/exchange/local_exchange_sink_operator.h"
23
#include "exec/exchange/local_exchange_source_operator.h"
24
#include "exec/operator/aggregation_sink_operator.h"
25
#include "exec/operator/aggregation_source_operator.h"
26
#include "exec/operator/analytic_sink_operator.h"
27
#include "exec/operator/analytic_source_operator.h"
28
#include "exec/operator/assert_num_rows_operator.h"
29
#include "exec/operator/blackhole_sink_operator.h"
30
#include "exec/operator/cache_sink_operator.h"
31
#include "exec/operator/cache_source_operator.h"
32
#include "exec/operator/datagen_operator.h"
33
#include "exec/operator/dict_sink_operator.h"
34
#include "exec/operator/distinct_streaming_aggregation_operator.h"
35
#include "exec/operator/empty_set_operator.h"
36
#include "exec/operator/es_scan_operator.h"
37
#include "exec/operator/exchange_sink_operator.h"
38
#include "exec/operator/exchange_source_operator.h"
39
#include "exec/operator/file_scan_operator.h"
40
#include "exec/operator/group_commit_block_sink_operator.h"
41
#include "exec/operator/group_commit_scan_operator.h"
42
#include "exec/operator/hashjoin_build_sink.h"
43
#include "exec/operator/hashjoin_probe_operator.h"
44
#include "exec/operator/hive_table_sink_operator.h"
45
#include "exec/operator/iceberg_delete_sink_operator.h"
46
#include "exec/operator/iceberg_merge_sink_operator.h"
47
#include "exec/operator/iceberg_table_sink_operator.h"
48
#include "exec/operator/jdbc_scan_operator.h"
49
#include "exec/operator/jdbc_table_sink_operator.h"
50
#include "exec/operator/local_merge_sort_source_operator.h"
51
#include "exec/operator/materialization_opertor.h"
52
#include "exec/operator/maxcompute_table_sink_operator.h"
53
#include "exec/operator/memory_scratch_sink_operator.h"
54
#include "exec/operator/meta_scan_operator.h"
55
#include "exec/operator/mock_operator.h"
56
#include "exec/operator/mock_scan_operator.h"
57
#include "exec/operator/multi_cast_data_stream_sink.h"
58
#include "exec/operator/multi_cast_data_stream_source.h"
59
#include "exec/operator/nested_loop_join_build_operator.h"
60
#include "exec/operator/nested_loop_join_probe_operator.h"
61
#include "exec/operator/olap_scan_operator.h"
62
#include "exec/operator/olap_table_sink_operator.h"
63
#include "exec/operator/olap_table_sink_v2_operator.h"
64
#include "exec/operator/partition_sort_sink_operator.h"
65
#include "exec/operator/partition_sort_source_operator.h"
66
#include "exec/operator/partitioned_aggregation_sink_operator.h"
67
#include "exec/operator/partitioned_aggregation_source_operator.h"
68
#include "exec/operator/partitioned_hash_join_probe_operator.h"
69
#include "exec/operator/partitioned_hash_join_sink_operator.h"
70
#include "exec/operator/rec_cte_anchor_sink_operator.h"
71
#include "exec/operator/rec_cte_scan_operator.h"
72
#include "exec/operator/rec_cte_sink_operator.h"
73
#include "exec/operator/rec_cte_source_operator.h"
74
#include "exec/operator/repeat_operator.h"
75
#include "exec/operator/result_file_sink_operator.h"
76
#include "exec/operator/result_sink_operator.h"
77
#include "exec/operator/schema_scan_operator.h"
78
#include "exec/operator/select_operator.h"
79
#include "exec/operator/set_probe_sink_operator.h"
80
#include "exec/operator/set_sink_operator.h"
81
#include "exec/operator/set_source_operator.h"
82
#include "exec/operator/sort_sink_operator.h"
83
#include "exec/operator/sort_source_operator.h"
84
#include "exec/operator/spill_iceberg_table_sink_operator.h"
85
#include "exec/operator/spill_sort_sink_operator.h"
86
#include "exec/operator/spill_sort_source_operator.h"
87
#include "exec/operator/streaming_aggregation_operator.h"
88
#include "exec/operator/table_function_operator.h"
89
#include "exec/operator/tvf_table_sink_operator.h"
90
#include "exec/operator/union_sink_operator.h"
91
#include "exec/operator/union_source_operator.h"
92
#include "exec/pipeline/dependency.h"
93
#include "exec/pipeline/pipeline.h"
94
#include "exprs/vexpr.h"
95
#include "exprs/vexpr_context.h"
96
#include "runtime/runtime_profile.h"
97
#include "runtime/runtime_profile_counter_names.h"
98
#include "util/debug_util.h"
99
#include "util/string_util.h"
100
101
namespace doris {
102
class RowDescriptor;
103
class RuntimeState;
104
} // namespace doris
105
106
namespace doris {
107
108
0
Status OperatorBase::close(RuntimeState* state) {
109
0
    if (_is_closed) {
110
0
        return Status::OK();
111
0
    }
112
0
    _is_closed = true;
113
0
    return Status::OK();
114
0
}
115
116
template <typename SharedStateArg>
117
2.09M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
2.09M
    if (_parent->nereids_id() == -1) {
119
1.07M
        return fmt::format("(id={})", _parent->node_id());
120
1.07M
    } else {
121
1.01M
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
1.01M
    }
123
2.09M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
96.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
96.8k
    if (_parent->nereids_id() == -1) {
119
0
        return fmt::format("(id={})", _parent->node_id());
120
96.8k
    } else {
121
96.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
96.8k
    }
123
96.8k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
1
    if (_parent->nereids_id() == -1) {
119
1
        return fmt::format("(id={})", _parent->node_id());
120
1
    } else {
121
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
0
    }
123
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
276k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
276k
    if (_parent->nereids_id() == -1) {
119
12
        return fmt::format("(id={})", _parent->node_id());
120
276k
    } else {
121
276k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
276k
    }
123
276k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
25
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
25
    if (_parent->nereids_id() == -1) {
119
0
        return fmt::format("(id={})", _parent->node_id());
120
25
    } else {
121
25
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
25
    }
123
25
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
8.83k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
8.83k
    if (_parent->nereids_id() == -1) {
119
0
        return fmt::format("(id={})", _parent->node_id());
120
8.83k
    } else {
121
8.83k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
8.83k
    }
123
8.83k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
8.95k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
8.95k
    if (_parent->nereids_id() == -1) {
119
9
        return fmt::format("(id={})", _parent->node_id());
120
8.95k
    } else {
121
8.95k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
8.95k
    }
123
8.95k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
135k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
135k
    if (_parent->nereids_id() == -1) {
119
27
        return fmt::format("(id={})", _parent->node_id());
120
135k
    } else {
121
135k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
135k
    }
123
135k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
140
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
140
    if (_parent->nereids_id() == -1) {
119
0
        return fmt::format("(id={})", _parent->node_id());
120
140
    } else {
121
140
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
140
    }
123
140
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
810k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
810k
    if (_parent->nereids_id() == -1) {
119
380k
        return fmt::format("(id={})", _parent->node_id());
120
429k
    } else {
121
429k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
429k
    }
123
810k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
54.2k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
54.2k
    if (_parent->nereids_id() == -1) {
119
2
        return fmt::format("(id={})", _parent->node_id());
120
54.2k
    } else {
121
54.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
54.2k
    }
123
54.2k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
17
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
17
    if (_parent->nereids_id() == -1) {
119
17
        return fmt::format("(id={})", _parent->node_id());
120
17
    } else {
121
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
0
    }
123
17
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
9.09k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
9.09k
    if (_parent->nereids_id() == -1) {
119
9.09k
        return fmt::format("(id={})", _parent->node_id());
120
18.4E
    } else {
121
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
18.4E
    }
123
9.09k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
438
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
438
    if (_parent->nereids_id() == -1) {
119
102
        return fmt::format("(id={})", _parent->node_id());
120
336
    } else {
121
336
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
336
    }
123
438
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
4.63k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
4.63k
    if (_parent->nereids_id() == -1) {
119
12
        return fmt::format("(id={})", _parent->node_id());
120
4.62k
    } else {
121
4.62k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
4.62k
    }
123
4.63k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
686k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
686k
    if (_parent->nereids_id() == -1) {
119
685k
        return fmt::format("(id={})", _parent->node_id());
120
685k
    } else {
121
820
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
820
    }
123
686k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
117
151
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
118
151
    if (_parent->nereids_id() == -1) {
119
0
        return fmt::format("(id={})", _parent->node_id());
120
151
    } else {
121
151
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
122
151
    }
123
151
}
124
125
template <typename SharedStateArg>
126
1.33M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
1.33M
    if (_parent->nereids_id() == -1) {
128
745k
        return fmt::format("(id={})", _parent->node_id());
129
745k
    } else {
130
587k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
587k
    }
132
1.33M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
145k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
145k
    if (_parent->nereids_id() == -1) {
128
0
        return fmt::format("(id={})", _parent->node_id());
129
145k
    } else {
130
145k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
145k
    }
132
145k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
2
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
2
    if (_parent->nereids_id() == -1) {
128
1
        return fmt::format("(id={})", _parent->node_id());
129
1
    } else {
130
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
1
    }
132
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
279k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
279k
    if (_parent->nereids_id() == -1) {
128
9
        return fmt::format("(id={})", _parent->node_id());
129
279k
    } else {
130
279k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
279k
    }
132
279k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
31
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
31
    if (_parent->nereids_id() == -1) {
128
0
        return fmt::format("(id={})", _parent->node_id());
129
31
    } else {
130
31
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
31
    }
132
31
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
8.86k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
8.86k
    if (_parent->nereids_id() == -1) {
128
0
        return fmt::format("(id={})", _parent->node_id());
129
8.86k
    } else {
130
8.86k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
8.86k
    }
132
8.86k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
8.97k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
8.97k
    if (_parent->nereids_id() == -1) {
128
9
        return fmt::format("(id={})", _parent->node_id());
129
8.96k
    } else {
130
8.96k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
8.96k
    }
132
8.97k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
136k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
136k
    if (_parent->nereids_id() == -1) {
128
27
        return fmt::format("(id={})", _parent->node_id());
129
136k
    } else {
130
136k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
136k
    }
132
136k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
150
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
150
    if (_parent->nereids_id() == -1) {
128
0
        return fmt::format("(id={})", _parent->node_id());
129
150
    } else {
130
150
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
150
    }
132
150
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
86
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
86
    if (_parent->nereids_id() == -1) {
128
86
        return fmt::format("(id={})", _parent->node_id());
129
86
    } else {
130
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
0
    }
132
86
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
8.01k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
8.01k
    if (_parent->nereids_id() == -1) {
128
3
        return fmt::format("(id={})", _parent->node_id());
129
8.01k
    } else {
130
8.01k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
8.01k
    }
132
8.01k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
438
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
438
    if (_parent->nereids_id() == -1) {
128
102
        return fmt::format("(id={})", _parent->node_id());
129
336
    } else {
130
336
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
336
    }
132
438
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
11.8k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
11.8k
    if (_parent->nereids_id() == -1) {
128
11.7k
        return fmt::format("(id={})", _parent->node_id());
129
11.7k
    } else {
130
7
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
7
    }
132
11.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
269k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
269k
    if (_parent->nereids_id() == -1) {
128
269k
        return fmt::format("(id={})", _parent->node_id());
129
18.4E
    } else {
130
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
18.4E
    }
132
269k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
464k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
464k
    if (_parent->nereids_id() == -1) {
128
464k
        return fmt::format("(id={})", _parent->node_id());
129
464k
    } else {
130
365
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
365
    }
132
464k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
17
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
17
    if (_parent->nereids_id() == -1) {
128
17
        return fmt::format("(id={})", _parent->node_id());
129
17
    } else {
130
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
0
    }
132
17
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
126
302
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
127
302
    if (_parent->nereids_id() == -1) {
128
0
        return fmt::format("(id={})", _parent->node_id());
129
302
    } else {
130
302
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
131
302
    }
132
302
}
133
134
template <typename SharedStateArg>
135
30.7k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
30.7k
    if (_terminated) {
137
1
        return Status::OK();
138
1
    }
139
30.7k
    _terminated = true;
140
30.7k
    return Status::OK();
141
30.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
24.0k
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
24.0k
    _terminated = true;
140
24.0k
    return Status::OK();
141
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
847
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
847
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
847
    _terminated = true;
140
847
    return Status::OK();
141
847
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
4
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
4
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
4
    _terminated = true;
140
4
    return Status::OK();
141
4
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
7
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
7
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
7
    _terminated = true;
140
7
    return Status::OK();
141
7
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
4.05k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
4.05k
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
4.05k
    _terminated = true;
140
4.05k
    return Status::OK();
141
4.05k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
1.19k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
1.19k
    if (_terminated) {
137
1
        return Status::OK();
138
1
    }
139
1.19k
    _terminated = true;
140
1.19k
    return Status::OK();
141
1.19k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
6
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
6
    _terminated = true;
140
6
    return Status::OK();
141
6
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
1
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
1
    _terminated = true;
140
1
    return Status::OK();
141
1
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
178
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
178
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
178
    _terminated = true;
140
178
    return Status::OK();
141
178
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
232
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
232
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
232
    _terminated = true;
140
232
    return Status::OK();
141
232
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
1
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
1
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
1
    _terminated = true;
140
1
    return Status::OK();
141
1
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
135
142
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
136
142
    if (_terminated) {
137
0
        return Status::OK();
138
0
    }
139
142
    _terminated = true;
140
142
    return Status::OK();
141
142
}
142
143
795k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
144
795k
    return _child && _child->is_serial_operator() && !is_source()
145
795k
                   ? DataDistribution(ExchangeType::PASSTHROUGH)
146
795k
                   : DataDistribution(ExchangeType::NOOP);
147
795k
}
148
149
81.6k
const RowDescriptor& OperatorBase::row_desc() const {
150
81.6k
    return _child->row_desc();
151
81.6k
}
152
153
template <typename SharedStateArg>
154
15.2k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
155
15.2k
    fmt::memory_buffer debug_string_buffer;
156
15.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
157
15.2k
    return fmt::to_string(debug_string_buffer);
158
15.2k
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
154
6
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
155
6
    fmt::memory_buffer debug_string_buffer;
156
6
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
157
6
    return fmt::to_string(debug_string_buffer);
158
6
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
154
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
155
3
    fmt::memory_buffer debug_string_buffer;
156
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
157
3
    return fmt::to_string(debug_string_buffer);
158
3
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
154
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
155
3
    fmt::memory_buffer debug_string_buffer;
156
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
157
3
    return fmt::to_string(debug_string_buffer);
158
3
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
154
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
155
1
    fmt::memory_buffer debug_string_buffer;
156
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
157
1
    return fmt::to_string(debug_string_buffer);
158
1
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
154
6
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
155
6
    fmt::memory_buffer debug_string_buffer;
156
6
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
157
6
    return fmt::to_string(debug_string_buffer);
158
6
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
154
15.2k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
155
15.2k
    fmt::memory_buffer debug_string_buffer;
156
15.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
157
15.2k
    return fmt::to_string(debug_string_buffer);
158
15.2k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
154
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
155
1
    fmt::memory_buffer debug_string_buffer;
156
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
157
1
    return fmt::to_string(debug_string_buffer);
158
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
159
160
template <typename SharedStateArg>
161
15.2k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
162
15.2k
    fmt::memory_buffer debug_string_buffer;
163
15.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
164
15.2k
    return fmt::to_string(debug_string_buffer);
165
15.2k
}
_ZNK5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
161
2
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
162
2
    fmt::memory_buffer debug_string_buffer;
163
2
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
164
2
    return fmt::to_string(debug_string_buffer);
165
2
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
161
3
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
162
3
    fmt::memory_buffer debug_string_buffer;
163
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
164
3
    return fmt::to_string(debug_string_buffer);
165
3
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
161
2
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
162
2
    fmt::memory_buffer debug_string_buffer;
163
2
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
164
2
    return fmt::to_string(debug_string_buffer);
165
2
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
161
4
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
162
4
    fmt::memory_buffer debug_string_buffer;
163
4
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
164
4
    return fmt::to_string(debug_string_buffer);
165
4
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
161
8
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
162
8
    fmt::memory_buffer debug_string_buffer;
163
8
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
164
8
    return fmt::to_string(debug_string_buffer);
165
8
}
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
161
15.2k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
162
15.2k
    fmt::memory_buffer debug_string_buffer;
163
15.2k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
164
15.2k
    return fmt::to_string(debug_string_buffer);
165
15.2k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
166
167
15.6k
std::string OperatorXBase::debug_string(int indentation_level) const {
168
15.6k
    fmt::memory_buffer debug_string_buffer;
169
15.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
170
15.6k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
171
15.6k
                   _is_serial_operator);
172
15.6k
    return fmt::to_string(debug_string_buffer);
173
15.6k
}
174
175
15.2k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
176
15.2k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
177
15.2k
}
178
179
693k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
180
693k
    std::string node_name = print_plan_node_type(tnode.node_type);
181
693k
    _nereids_id = tnode.nereids_id;
182
693k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
183
3.00k
        if (!tnode.__isset.output_tuple_id) {
184
0
            return Status::InternalError("no final output tuple id");
185
0
        }
186
3.00k
        if (tnode.intermediate_output_tuple_id_list.size() !=
187
3.00k
            tnode.intermediate_projections_list.size()) {
188
0
            return Status::InternalError(
189
0
                    "intermediate_output_tuple_id_list size:{} not match "
190
0
                    "intermediate_projections_list size:{}",
191
0
                    tnode.intermediate_output_tuple_id_list.size(),
192
0
                    tnode.intermediate_projections_list.size());
193
0
        }
194
3.00k
    }
195
693k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
196
693k
    _op_name = substr + "_OPERATOR";
197
198
693k
    if (tnode.__isset.vconjunct) {
199
0
        return Status::InternalError("vconjunct is not supported yet");
200
693k
    } else if (tnode.__isset.conjuncts) {
201
437k
        for (const auto& conjunct : tnode.conjuncts) {
202
437k
            VExprContextSPtr context;
203
437k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
204
437k
            _conjuncts.emplace_back(context);
205
437k
        }
206
138k
    }
207
208
    // create the projections expr
209
693k
    if (tnode.__isset.projections) {
210
303k
        DCHECK(tnode.__isset.output_tuple_id);
211
303k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projections));
212
303k
    }
213
693k
    if (!tnode.intermediate_projections_list.empty()) {
214
3.00k
        DCHECK(tnode.__isset.projections) << "no final projections";
215
3.00k
        _intermediate_projections.reserve(tnode.intermediate_projections_list.size());
216
4.08k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
217
4.08k
            VExprContextSPtrs projections;
218
4.08k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
219
4.08k
            _intermediate_projections.push_back(projections);
220
4.08k
        }
221
3.00k
    }
222
693k
    return Status::OK();
223
693k
}
224
225
724k
Status OperatorXBase::prepare(RuntimeState* state) {
226
724k
    for (auto& conjunct : _conjuncts) {
227
436k
        RETURN_IF_ERROR(conjunct->prepare(state, intermediate_row_desc()));
228
436k
    }
229
724k
    if (state->enable_adjust_conjunct_order_by_cost()) {
230
674k
        std::ranges::sort(_conjuncts, [](const auto& a, const auto& b) {
231
595k
            return a->execute_cost() < b->execute_cost();
232
595k
        });
233
674k
    };
234
235
728k
    for (int i = 0; i < _intermediate_projections.size(); i++) {
236
4.08k
        RETURN_IF_ERROR(
237
4.08k
                VExpr::prepare(_intermediate_projections[i], state, intermediate_row_desc(i)));
238
4.08k
    }
239
724k
    RETURN_IF_ERROR(VExpr::prepare(_projections, state, projections_row_desc()));
240
241
724k
    if (has_output_row_desc()) {
242
303k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(_projections, *_output_row_descriptor));
243
303k
    }
244
245
724k
    for (auto& conjunct : _conjuncts) {
246
436k
        RETURN_IF_ERROR(conjunct->open(state));
247
436k
    }
248
724k
    RETURN_IF_ERROR(VExpr::open(_projections, state));
249
724k
    for (auto& projections : _intermediate_projections) {
250
4.08k
        RETURN_IF_ERROR(VExpr::open(projections, state));
251
4.08k
    }
252
724k
    if (_child && !is_source()) {
253
137k
        RETURN_IF_ERROR(_child->prepare(state));
254
137k
    }
255
256
724k
    if (VExpr::contains_blockable_function(_conjuncts) ||
257
724k
        VExpr::contains_blockable_function(_projections)) {
258
0
        _blockable = true;
259
0
    }
260
261
724k
    return Status::OK();
262
724k
}
263
264
8.72k
Status OperatorXBase::terminate(RuntimeState* state) {
265
8.72k
    if (_child && !is_source()) {
266
2.00k
        RETURN_IF_ERROR(_child->terminate(state));
267
2.00k
    }
268
8.72k
    auto result = state->get_local_state_result(operator_id());
269
8.72k
    if (!result) {
270
0
        return result.error();
271
0
    }
272
8.72k
    return result.value()->terminate(state);
273
8.72k
}
274
275
5.90M
Status OperatorXBase::close(RuntimeState* state) {
276
5.90M
    if (_child && !is_source()) {
277
1.07M
        RETURN_IF_ERROR(_child->close(state));
278
1.07M
    }
279
5.90M
    auto result = state->get_local_state_result(operator_id());
280
5.90M
    if (!result) {
281
0
        return result.error();
282
0
    }
283
5.90M
    return result.value()->close(state);
284
5.90M
}
285
286
307k
void PipelineXLocalStateBase::clear_origin_block() {
287
307k
    _origin_block.clear_column_data(_parent->intermediate_row_desc().num_materialized_slots());
288
307k
}
289
290
535k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
291
535k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
292
293
535k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
294
535k
    return Status::OK();
295
535k
}
296
297
0
bool PipelineXLocalStateBase::is_blockable() const {
298
0
    return std::any_of(_projections.begin(), _projections.end(),
299
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
300
0
}
301
302
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
303
307k
                                     Block* output_block) const {
304
307k
    auto* local_state = state->get_local_state(operator_id());
305
307k
    SCOPED_TIMER(local_state->exec_time_counter());
306
307k
    SCOPED_TIMER(local_state->_projection_timer);
307
307k
    const size_t rows = origin_block->rows();
308
307k
    if (rows == 0) {
309
173k
        return Status::OK();
310
173k
    }
311
134k
    Block input_block = *origin_block;
312
313
134k
    size_t bytes_usage = 0;
314
134k
    ColumnsWithTypeAndName new_columns;
315
134k
    for (const auto& projections : local_state->_intermediate_projections) {
316
1.12k
        if (projections.empty()) {
317
0
            return Status::InternalError("meet empty intermediate projection, node id: {}",
318
0
                                         node_id());
319
0
        }
320
1.12k
        new_columns.resize(projections.size());
321
8.25k
        for (int i = 0; i < projections.size(); i++) {
322
7.12k
            RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
323
7.12k
            if (new_columns[i].column->size() != rows) {
324
0
                return Status::InternalError(
325
0
                        "intermediate projection result column size {} not equal input rows {}, "
326
0
                        "expr: {}",
327
0
                        new_columns[i].column->size(), rows,
328
0
                        projections[i]->root()->debug_string());
329
0
            }
330
7.12k
        }
331
1.12k
        Block tmp_block {new_columns};
332
1.12k
        bytes_usage += tmp_block.allocated_bytes();
333
1.12k
        input_block.swap(tmp_block);
334
1.12k
    }
335
336
134k
    if (input_block.rows() != rows) {
337
0
        return Status::InternalError(
338
0
                "after intermediate projections input block rows {} not equal origin rows {}, "
339
0
                "input_block: {}",
340
0
                input_block.rows(), rows, input_block.dump_structure());
341
0
    }
342
642k
    auto insert_column_datas = [&](auto& to, ColumnPtr& from, size_t rows) {
343
642k
        if (to->is_nullable() && !from->is_nullable()) {
344
0
            if (_keep_origin || !from->is_exclusive()) {
345
0
                auto& null_column = reinterpret_cast<ColumnNullable&>(*to);
346
0
                null_column.get_nested_column().insert_range_from(*from, 0, rows);
347
0
                null_column.get_null_map_column().get_data().resize_fill(rows, 0);
348
0
                bytes_usage += null_column.allocated_bytes();
349
0
            } else {
350
0
                to = make_nullable(from, false)->assume_mutable();
351
0
            }
352
642k
        } else {
353
642k
            if (_keep_origin || !from->is_exclusive()) {
354
628k
                to->insert_range_from(*from, 0, rows);
355
628k
                bytes_usage += from->allocated_bytes();
356
628k
            } else {
357
13.5k
                to = from->assume_mutable();
358
13.5k
            }
359
642k
        }
360
642k
    };
361
362
134k
    MutableBlock mutable_block =
363
134k
            VectorizedUtils::build_mutable_mem_reuse_block(output_block, *_output_row_descriptor);
364
134k
    if (rows != 0) {
365
134k
        auto& mutable_columns = mutable_block.mutable_columns();
366
134k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
367
776k
        for (int i = 0; i < mutable_columns.size(); ++i) {
368
642k
            ColumnPtr column_ptr;
369
642k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
370
642k
            if (column_ptr->size() != rows) {
371
0
                return Status::InternalError(
372
0
                        "projection result column size {} not equal input rows {}, expr: {}",
373
0
                        column_ptr->size(), rows,
374
0
                        local_state->_projections[i]->root()->debug_string());
375
0
            }
376
642k
            column_ptr = column_ptr->convert_to_full_column_if_const();
377
642k
            bytes_usage += column_ptr->allocated_bytes();
378
642k
            insert_column_datas(mutable_columns[i], column_ptr, rows);
379
642k
        }
380
134k
        DCHECK(mutable_block.rows() == rows);
381
134k
        output_block->set_columns(std::move(mutable_columns));
382
134k
    }
383
384
134k
    local_state->_estimate_memory_usage += bytes_usage;
385
386
134k
    return Status::OK();
387
134k
}
388
389
4.48M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
390
4.48M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
391
4.48M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
392
4.48M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
393
4.48M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
394
4.48M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
395
4.48M
            if (_debug_point_count++ % 2 == 0) {
396
4.48M
                return Status::OK();
397
4.48M
            }
398
4.48M
        }
399
4.48M
    });
400
401
4.48M
    Status status;
402
4.48M
    auto* local_state = state->get_local_state(operator_id());
403
4.48M
    Defer defer([&]() {
404
4.48M
        if (status.ok()) {
405
4.48M
            if (auto rows = block->rows()) {
406
860k
                COUNTER_UPDATE(local_state->_rows_returned_counter, rows);
407
860k
                COUNTER_UPDATE(local_state->_blocks_returned_counter, 1);
408
860k
            }
409
4.48M
        }
410
4.48M
    });
411
4.48M
    if (_output_row_descriptor) {
412
307k
        local_state->clear_origin_block();
413
307k
        status = get_block(state, &local_state->_origin_block, eos);
414
307k
        if (UNLIKELY(!status.ok())) {
415
22
            return status;
416
22
        }
417
307k
        status = do_projections(state, &local_state->_origin_block, block);
418
307k
        return status;
419
307k
    }
420
4.17M
    status = get_block(state, block, eos);
421
4.17M
    RETURN_IF_ERROR(block->check_type_and_column());
422
4.17M
    return status;
423
4.17M
}
424
425
3.03M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
426
3.03M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
427
6.40k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
428
6.40k
        *eos = true;
429
6.40k
    }
430
431
3.03M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
432
3.03M
        auto op_name = to_lower(_parent->_op_name);
433
3.03M
        auto arg_op_name = dp->param<std::string>("op_name");
434
3.03M
        arg_op_name = to_lower(arg_op_name);
435
436
3.03M
        if (op_name == arg_op_name) {
437
3.03M
            *eos = true;
438
3.03M
        }
439
3.03M
    });
440
441
3.03M
    if (auto rows = block->rows()) {
442
805k
        _num_rows_returned += rows;
443
805k
    }
444
3.03M
}
445
446
30.7k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
447
30.7k
    auto result = state->get_sink_local_state_result();
448
30.7k
    if (!result) {
449
0
        return result.error();
450
0
    }
451
30.7k
    return result.value()->terminate(state);
452
30.7k
}
453
454
15.6k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
455
15.6k
    fmt::memory_buffer debug_string_buffer;
456
457
15.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
458
15.6k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
459
15.6k
    return fmt::to_string(debug_string_buffer);
460
15.6k
}
461
462
15.2k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
463
15.2k
    return state->get_sink_local_state()->debug_string(indentation_level);
464
15.2k
}
465
466
435k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
467
435k
    std::string op_name = "UNKNOWN_SINK";
468
435k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
469
470
436k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
471
436k
        op_name = it->second;
472
436k
    }
473
435k
    _name = op_name + "_OPERATOR";
474
435k
    return Status::OK();
475
435k
}
476
477
196k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
478
196k
    std::string op_name = print_plan_node_type(tnode.node_type);
479
196k
    _nereids_id = tnode.nereids_id;
480
196k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
481
196k
    _name = substr + "_SINK_OPERATOR";
482
196k
    return Status::OK();
483
196k
}
484
485
template <typename LocalStateType>
486
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
487
1.98M
                                                            LocalSinkStateInfo& info) {
488
1.98M
    auto local_state = LocalStateType::create_unique(this, state);
489
1.98M
    RETURN_IF_ERROR(local_state->init(state, info));
490
1.98M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
1.98M
    return Status::OK();
492
1.98M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
145k
                                                            LocalSinkStateInfo& info) {
488
145k
    auto local_state = LocalStateType::create_unique(this, state);
489
145k
    RETURN_IF_ERROR(local_state->init(state, info));
490
145k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
145k
    return Status::OK();
492
145k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
398k
                                                            LocalSinkStateInfo& info) {
488
398k
    auto local_state = LocalStateType::create_unique(this, state);
489
398k
    RETURN_IF_ERROR(local_state->init(state, info));
490
398k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
398k
    return Status::OK();
492
398k
}
_ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
80
                                                            LocalSinkStateInfo& info) {
488
80
    auto local_state = LocalStateType::create_unique(this, state);
489
80
    RETURN_IF_ERROR(local_state->init(state, info));
490
80
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
80
    return Status::OK();
492
80
}
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
3
                                                            LocalSinkStateInfo& info) {
488
3
    auto local_state = LocalStateType::create_unique(this, state);
489
3
    RETURN_IF_ERROR(local_state->init(state, info));
490
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
3
    return Status::OK();
492
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
518
                                                            LocalSinkStateInfo& info) {
488
518
    auto local_state = LocalStateType::create_unique(this, state);
489
518
    RETURN_IF_ERROR(local_state->init(state, info));
490
518
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
518
    return Status::OK();
492
518
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
52.0k
                                                            LocalSinkStateInfo& info) {
488
52.0k
    auto local_state = LocalStateType::create_unique(this, state);
489
52.0k
    RETURN_IF_ERROR(local_state->init(state, info));
490
52.0k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
52.0k
    return Status::OK();
492
52.0k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
5.51k
                                                            LocalSinkStateInfo& info) {
488
5.51k
    auto local_state = LocalStateType::create_unique(this, state);
489
5.51k
    RETURN_IF_ERROR(local_state->init(state, info));
490
5.51k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
5.51k
    return Status::OK();
492
5.51k
}
_ZN5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
5.14k
                                                            LocalSinkStateInfo& info) {
488
5.14k
    auto local_state = LocalStateType::create_unique(this, state);
489
5.14k
    RETURN_IF_ERROR(local_state->init(state, info));
490
5.14k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
5.14k
    return Status::OK();
492
5.14k
}
_ZN5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
156
                                                            LocalSinkStateInfo& info) {
488
156
    auto local_state = LocalStateType::create_unique(this, state);
489
156
    RETURN_IF_ERROR(local_state->init(state, info));
490
156
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
156
    return Status::OK();
492
156
}
_ZN5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
3.38k
                                                            LocalSinkStateInfo& info) {
488
3.38k
    auto local_state = LocalStateType::create_unique(this, state);
489
3.38k
    RETURN_IF_ERROR(local_state->init(state, info));
490
3.38k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
3.38k
    return Status::OK();
492
3.38k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
160
                                                            LocalSinkStateInfo& info) {
488
160
    auto local_state = LocalStateType::create_unique(this, state);
489
160
    RETURN_IF_ERROR(local_state->init(state, info));
490
160
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
160
    return Status::OK();
492
160
}
_ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
640
                                                            LocalSinkStateInfo& info) {
488
640
    auto local_state = LocalStateType::create_unique(this, state);
489
640
    RETURN_IF_ERROR(local_state->init(state, info));
490
640
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
640
    return Status::OK();
492
640
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
8.96k
                                                            LocalSinkStateInfo& info) {
488
8.96k
    auto local_state = LocalStateType::create_unique(this, state);
489
8.96k
    RETURN_IF_ERROR(local_state->init(state, info));
490
8.96k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
8.96k
    return Status::OK();
492
8.96k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
83
                                                            LocalSinkStateInfo& info) {
488
83
    auto local_state = LocalStateType::create_unique(this, state);
489
83
    RETURN_IF_ERROR(local_state->init(state, info));
490
83
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
83
    return Status::OK();
492
83
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
279k
                                                            LocalSinkStateInfo& info) {
488
279k
    auto local_state = LocalStateType::create_unique(this, state);
489
279k
    RETURN_IF_ERROR(local_state->init(state, info));
490
279k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
279k
    return Status::OK();
492
279k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
31
                                                            LocalSinkStateInfo& info) {
488
31
    auto local_state = LocalStateType::create_unique(this, state);
489
31
    RETURN_IF_ERROR(local_state->init(state, info));
490
31
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
31
    return Status::OK();
492
31
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
269k
                                                            LocalSinkStateInfo& info) {
488
269k
    auto local_state = LocalStateType::create_unique(this, state);
489
269k
    RETURN_IF_ERROR(local_state->init(state, info));
490
269k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
269k
    return Status::OK();
492
269k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
136k
                                                            LocalSinkStateInfo& info) {
488
136k
    auto local_state = LocalStateType::create_unique(this, state);
489
136k
    RETURN_IF_ERROR(local_state->init(state, info));
490
136k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
136k
    return Status::OK();
492
136k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
150
                                                            LocalSinkStateInfo& info) {
488
150
    auto local_state = LocalStateType::create_unique(this, state);
489
150
    RETURN_IF_ERROR(local_state->init(state, info));
490
150
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
150
    return Status::OK();
492
150
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
647k
                                                            LocalSinkStateInfo& info) {
488
647k
    auto local_state = LocalStateType::create_unique(this, state);
489
647k
    RETURN_IF_ERROR(local_state->init(state, info));
490
647k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
647k
    return Status::OK();
492
647k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
8.86k
                                                            LocalSinkStateInfo& info) {
488
8.86k
    auto local_state = LocalStateType::create_unique(this, state);
489
8.86k
    RETURN_IF_ERROR(local_state->init(state, info));
490
8.86k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
8.86k
    return Status::OK();
492
8.86k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
8.01k
                                                            LocalSinkStateInfo& info) {
488
8.01k
    auto local_state = LocalStateType::create_unique(this, state);
489
8.01k
    RETURN_IF_ERROR(local_state->init(state, info));
490
8.01k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
8.01k
    return Status::OK();
492
8.01k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
3.22k
                                                            LocalSinkStateInfo& info) {
488
3.22k
    auto local_state = LocalStateType::create_unique(this, state);
489
3.22k
    RETURN_IF_ERROR(local_state->init(state, info));
490
3.22k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
3.22k
    return Status::OK();
492
3.22k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
336
                                                            LocalSinkStateInfo& info) {
488
336
    auto local_state = LocalStateType::create_unique(this, state);
489
336
    RETURN_IF_ERROR(local_state->init(state, info));
490
336
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
336
    return Status::OK();
492
336
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
4.53k
                                                            LocalSinkStateInfo& info) {
488
4.53k
    auto local_state = LocalStateType::create_unique(this, state);
489
4.53k
    RETURN_IF_ERROR(local_state->init(state, info));
490
4.53k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
4.53k
    return Status::OK();
492
4.53k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
2.47k
                                                            LocalSinkStateInfo& info) {
488
2.47k
    auto local_state = LocalStateType::create_unique(this, state);
489
2.47k
    RETURN_IF_ERROR(local_state->init(state, info));
490
2.47k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
2.47k
    return Status::OK();
492
2.47k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
2.33k
                                                            LocalSinkStateInfo& info) {
488
2.33k
    auto local_state = LocalStateType::create_unique(this, state);
489
2.33k
    RETURN_IF_ERROR(local_state->init(state, info));
490
2.33k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
2.33k
    return Status::OK();
492
2.33k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
2.41k
                                                            LocalSinkStateInfo& info) {
488
2.41k
    auto local_state = LocalStateType::create_unique(this, state);
489
2.41k
    RETURN_IF_ERROR(local_state->init(state, info));
490
2.41k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
2.41k
    return Status::OK();
492
2.41k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
1
                                                            LocalSinkStateInfo& info) {
488
1
    auto local_state = LocalStateType::create_unique(this, state);
489
1
    RETURN_IF_ERROR(local_state->init(state, info));
490
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
1
    return Status::OK();
492
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
165
                                                            LocalSinkStateInfo& info) {
488
165
    auto local_state = LocalStateType::create_unique(this, state);
489
165
    RETURN_IF_ERROR(local_state->init(state, info));
490
165
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
165
    return Status::OK();
492
165
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
14
                                                            LocalSinkStateInfo& info) {
488
14
    auto local_state = LocalStateType::create_unique(this, state);
489
14
    RETURN_IF_ERROR(local_state->init(state, info));
490
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
14
    return Status::OK();
492
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
105
                                                            LocalSinkStateInfo& info) {
488
105
    auto local_state = LocalStateType::create_unique(this, state);
489
105
    RETURN_IF_ERROR(local_state->init(state, info));
490
105
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
105
    return Status::OK();
492
105
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
151
                                                            LocalSinkStateInfo& info) {
488
151
    auto local_state = LocalStateType::create_unique(this, state);
489
151
    RETURN_IF_ERROR(local_state->init(state, info));
490
151
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
151
    return Status::OK();
492
151
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
487
151
                                                            LocalSinkStateInfo& info) {
488
151
    auto local_state = LocalStateType::create_unique(this, state);
489
151
    RETURN_IF_ERROR(local_state->init(state, info));
490
151
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
491
151
    return Status::OK();
492
151
}
493
494
template <typename LocalStateType>
495
1.67M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
0
                                 LocalExchangeSharedState>) {
498
0
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
0
                                        MultiCastSharedState>) {
501
0
        throw Exception(Status::FatalError("should not reach here!"));
502
1.67M
    } else {
503
1.67M
        auto ss = LocalStateType::SharedStateType::create_shared();
504
1.67M
        ss->id = operator_id();
505
1.67M
        for (auto& dest : dests_id()) {
506
1.67M
            ss->related_op_ids.insert(dest);
507
1.67M
        }
508
1.67M
        return ss;
509
1.67M
    }
510
1.67M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
124k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
124k
    } else {
503
124k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
124k
        ss->id = operator_id();
505
124k
        for (auto& dest : dests_id()) {
506
123k
            ss->related_op_ids.insert(dest);
507
123k
        }
508
124k
        return ss;
509
124k
    }
510
124k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
398k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
398k
    } else {
503
398k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
398k
        ss->id = operator_id();
505
398k
        for (auto& dest : dests_id()) {
506
397k
            ss->related_op_ids.insert(dest);
507
397k
        }
508
398k
        return ss;
509
398k
    }
510
398k
}
_ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
80
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
80
    } else {
503
80
        auto ss = LocalStateType::SharedStateType::create_shared();
504
80
        ss->id = operator_id();
505
80
        for (auto& dest : dests_id()) {
506
80
            ss->related_op_ids.insert(dest);
507
80
        }
508
80
        return ss;
509
80
    }
510
80
}
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
3
    } else {
503
3
        auto ss = LocalStateType::SharedStateType::create_shared();
504
3
        ss->id = operator_id();
505
3
        for (auto& dest : dests_id()) {
506
3
            ss->related_op_ids.insert(dest);
507
3
        }
508
3
        return ss;
509
3
    }
510
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
518
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
518
    } else {
503
518
        auto ss = LocalStateType::SharedStateType::create_shared();
504
518
        ss->id = operator_id();
505
518
        for (auto& dest : dests_id()) {
506
518
            ss->related_op_ids.insert(dest);
507
518
        }
508
518
        return ss;
509
518
    }
510
518
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
50.9k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
50.9k
    } else {
503
50.9k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
50.9k
        ss->id = operator_id();
505
50.9k
        for (auto& dest : dests_id()) {
506
50.6k
            ss->related_op_ids.insert(dest);
507
50.6k
        }
508
50.9k
        return ss;
509
50.9k
    }
510
50.9k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
495
5.01k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
5.01k
    } else {
503
5.01k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
5.01k
        ss->id = operator_id();
505
5.01k
        for (auto& dest : dests_id()) {
506
5.01k
            ss->related_op_ids.insert(dest);
507
5.01k
        }
508
5.01k
        return ss;
509
5.01k
    }
510
5.01k
}
_ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
5.14k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
5.14k
    } else {
503
5.14k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
5.14k
        ss->id = operator_id();
505
5.14k
        for (auto& dest : dests_id()) {
506
5.14k
            ss->related_op_ids.insert(dest);
507
5.14k
        }
508
5.14k
        return ss;
509
5.14k
    }
510
5.14k
}
_ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
156
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
156
    } else {
503
156
        auto ss = LocalStateType::SharedStateType::create_shared();
504
156
        ss->id = operator_id();
505
156
        for (auto& dest : dests_id()) {
506
156
            ss->related_op_ids.insert(dest);
507
156
        }
508
156
        return ss;
509
156
    }
510
156
}
_ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
3.38k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
3.38k
    } else {
503
3.38k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
3.38k
        ss->id = operator_id();
505
3.38k
        for (auto& dest : dests_id()) {
506
3.38k
            ss->related_op_ids.insert(dest);
507
3.38k
        }
508
3.38k
        return ss;
509
3.38k
    }
510
3.38k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
160
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
160
    } else {
503
160
        auto ss = LocalStateType::SharedStateType::create_shared();
504
160
        ss->id = operator_id();
505
160
        for (auto& dest : dests_id()) {
506
160
            ss->related_op_ids.insert(dest);
507
160
        }
508
160
        return ss;
509
160
    }
510
160
}
_ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
640
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
640
    } else {
503
640
        auto ss = LocalStateType::SharedStateType::create_shared();
504
640
        ss->id = operator_id();
505
640
        for (auto& dest : dests_id()) {
506
640
            ss->related_op_ids.insert(dest);
507
640
        }
508
640
        return ss;
509
640
    }
510
640
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
8.97k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
8.97k
    } else {
503
8.97k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
8.97k
        ss->id = operator_id();
505
8.98k
        for (auto& dest : dests_id()) {
506
8.98k
            ss->related_op_ids.insert(dest);
507
8.98k
        }
508
8.97k
        return ss;
509
8.97k
    }
510
8.97k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
83
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
83
    } else {
503
83
        auto ss = LocalStateType::SharedStateType::create_shared();
504
83
        ss->id = operator_id();
505
83
        for (auto& dest : dests_id()) {
506
83
            ss->related_op_ids.insert(dest);
507
83
        }
508
83
        return ss;
509
83
    }
510
83
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
279k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
279k
    } else {
503
279k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
279k
        ss->id = operator_id();
505
279k
        for (auto& dest : dests_id()) {
506
279k
            ss->related_op_ids.insert(dest);
507
279k
        }
508
279k
        return ss;
509
279k
    }
510
279k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
33
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
33
    } else {
503
33
        auto ss = LocalStateType::SharedStateType::create_shared();
504
33
        ss->id = operator_id();
505
33
        for (auto& dest : dests_id()) {
506
33
            ss->related_op_ids.insert(dest);
507
33
        }
508
33
        return ss;
509
33
    }
510
33
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
136k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
136k
    } else {
503
136k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
136k
        ss->id = operator_id();
505
136k
        for (auto& dest : dests_id()) {
506
136k
            ss->related_op_ids.insert(dest);
507
136k
        }
508
136k
        return ss;
509
136k
    }
510
136k
}
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
149
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
149
    } else {
503
149
        auto ss = LocalStateType::SharedStateType::create_shared();
504
149
        ss->id = operator_id();
505
149
        for (auto& dest : dests_id()) {
506
149
            ss->related_op_ids.insert(dest);
507
149
        }
508
149
        return ss;
509
149
    }
510
149
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
646k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
646k
    } else {
503
646k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
646k
        ss->id = operator_id();
505
646k
        for (auto& dest : dests_id()) {
506
644k
            ss->related_op_ids.insert(dest);
507
644k
        }
508
646k
        return ss;
509
646k
    }
510
646k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
8.85k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
8.85k
    } else {
503
8.85k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
8.85k
        ss->id = operator_id();
505
8.86k
        for (auto& dest : dests_id()) {
506
8.86k
            ss->related_op_ids.insert(dest);
507
8.86k
        }
508
8.85k
        return ss;
509
8.85k
    }
510
8.85k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
438
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
438
    } else {
503
438
        auto ss = LocalStateType::SharedStateType::create_shared();
504
438
        ss->id = operator_id();
505
438
        for (auto& dest : dests_id()) {
506
438
            ss->related_op_ids.insert(dest);
507
438
        }
508
438
        return ss;
509
438
    }
510
438
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
495
2.35k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
2.35k
    } else {
503
2.35k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
2.35k
        ss->id = operator_id();
505
2.35k
        for (auto& dest : dests_id()) {
506
2.34k
            ss->related_op_ids.insert(dest);
507
2.34k
        }
508
2.35k
        return ss;
509
2.35k
    }
510
2.35k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
495
2.41k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
2.41k
    } else {
503
2.41k
        auto ss = LocalStateType::SharedStateType::create_shared();
504
2.41k
        ss->id = operator_id();
505
2.41k
        for (auto& dest : dests_id()) {
506
2.40k
            ss->related_op_ids.insert(dest);
507
2.40k
        }
508
2.41k
        return ss;
509
2.41k
    }
510
2.41k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
165
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
165
    } else {
503
165
        auto ss = LocalStateType::SharedStateType::create_shared();
504
165
        ss->id = operator_id();
505
165
        for (auto& dest : dests_id()) {
506
165
            ss->related_op_ids.insert(dest);
507
165
        }
508
165
        return ss;
509
165
    }
510
165
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
495
105
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
496
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
497
                                 LocalExchangeSharedState>) {
498
        return nullptr;
499
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
500
                                        MultiCastSharedState>) {
501
        throw Exception(Status::FatalError("should not reach here!"));
502
105
    } else {
503
105
        auto ss = LocalStateType::SharedStateType::create_shared();
504
105
        ss->id = operator_id();
505
105
        for (auto& dest : dests_id()) {
506
103
            ss->related_op_ids.insert(dest);
507
103
        }
508
105
        return ss;
509
105
    }
510
105
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
511
512
template <typename LocalStateType>
513
2.44M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
2.44M
    auto local_state = LocalStateType::create_unique(state, this);
515
2.44M
    RETURN_IF_ERROR(local_state->init(state, info));
516
2.44M
    state->emplace_local_state(operator_id(), std::move(local_state));
517
2.44M
    return Status::OK();
518
2.44M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
97.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
97.2k
    auto local_state = LocalStateType::create_unique(state, this);
515
97.2k
    RETURN_IF_ERROR(local_state->init(state, info));
516
97.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
97.2k
    return Status::OK();
518
97.2k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
304k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
304k
    auto local_state = LocalStateType::create_unique(state, this);
515
304k
    RETURN_IF_ERROR(local_state->init(state, info));
516
304k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
304k
    return Status::OK();
518
304k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
79
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
79
    auto local_state = LocalStateType::create_unique(state, this);
515
79
    RETURN_IF_ERROR(local_state->init(state, info));
516
79
    state->emplace_local_state(operator_id(), std::move(local_state));
517
79
    return Status::OK();
518
79
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
31.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
31.0k
    auto local_state = LocalStateType::create_unique(state, this);
515
31.0k
    RETURN_IF_ERROR(local_state->init(state, info));
516
31.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
31.0k
    return Status::OK();
518
31.0k
}
_ZN5doris9OperatorXINS_16EsScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
592
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
592
    auto local_state = LocalStateType::create_unique(state, this);
515
592
    RETURN_IF_ERROR(local_state->init(state, info));
516
592
    state->emplace_local_state(operator_id(), std::move(local_state));
517
592
    return Status::OK();
518
592
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
8.94k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
8.94k
    auto local_state = LocalStateType::create_unique(state, this);
515
8.94k
    RETURN_IF_ERROR(local_state->init(state, info));
516
8.94k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
8.94k
    return Status::OK();
518
8.94k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
9.51k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
9.51k
    auto local_state = LocalStateType::create_unique(state, this);
515
9.51k
    RETURN_IF_ERROR(local_state->init(state, info));
516
9.51k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
9.51k
    return Status::OK();
518
9.51k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
25
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
25
    auto local_state = LocalStateType::create_unique(state, this);
515
25
    RETURN_IF_ERROR(local_state->init(state, info));
516
25
    state->emplace_local_state(operator_id(), std::move(local_state));
517
25
    return Status::OK();
518
25
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
269k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
269k
    auto local_state = LocalStateType::create_unique(state, this);
515
269k
    RETURN_IF_ERROR(local_state->init(state, info));
516
269k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
269k
    return Status::OK();
518
269k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
135k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
135k
    auto local_state = LocalStateType::create_unique(state, this);
515
135k
    RETURN_IF_ERROR(local_state->init(state, info));
516
135k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
135k
    return Status::OK();
518
135k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
140
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
140
    auto local_state = LocalStateType::create_unique(state, this);
515
140
    RETURN_IF_ERROR(local_state->init(state, info));
516
140
    state->emplace_local_state(operator_id(), std::move(local_state));
517
140
    return Status::OK();
518
140
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
5.02k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
5.02k
    auto local_state = LocalStateType::create_unique(state, this);
515
5.02k
    RETURN_IF_ERROR(local_state->init(state, info));
516
5.02k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
5.02k
    return Status::OK();
518
5.02k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
382k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
382k
    auto local_state = LocalStateType::create_unique(state, this);
515
382k
    RETURN_IF_ERROR(local_state->init(state, info));
516
382k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
382k
    return Status::OK();
518
382k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
1.27k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
1.27k
    auto local_state = LocalStateType::create_unique(state, this);
515
1.27k
    RETURN_IF_ERROR(local_state->init(state, info));
516
1.27k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
1.27k
    return Status::OK();
518
1.27k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
8.85k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
8.85k
    auto local_state = LocalStateType::create_unique(state, this);
515
8.85k
    RETURN_IF_ERROR(local_state->init(state, info));
516
8.85k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
8.85k
    return Status::OK();
518
8.85k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
221
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
221
    auto local_state = LocalStateType::create_unique(state, this);
515
221
    RETURN_IF_ERROR(local_state->init(state, info));
516
221
    state->emplace_local_state(operator_id(), std::move(local_state));
517
221
    return Status::OK();
518
221
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
1.58k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
1.58k
    auto local_state = LocalStateType::create_unique(state, this);
515
1.58k
    RETURN_IF_ERROR(local_state->init(state, info));
516
1.58k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
1.58k
    return Status::OK();
518
1.58k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
54.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
54.2k
    auto local_state = LocalStateType::create_unique(state, this);
515
54.2k
    RETURN_IF_ERROR(local_state->init(state, info));
516
54.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
54.2k
    return Status::OK();
518
54.2k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
9.09k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
9.09k
    auto local_state = LocalStateType::create_unique(state, this);
515
9.09k
    RETURN_IF_ERROR(local_state->init(state, info));
516
9.09k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
9.09k
    return Status::OK();
518
9.09k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
336
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
336
    auto local_state = LocalStateType::create_unique(state, this);
515
336
    RETURN_IF_ERROR(local_state->init(state, info));
516
336
    state->emplace_local_state(operator_id(), std::move(local_state));
517
336
    return Status::OK();
518
336
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
2.27k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
2.27k
    auto local_state = LocalStateType::create_unique(state, this);
515
2.27k
    RETURN_IF_ERROR(local_state->init(state, info));
516
2.27k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
2.27k
    return Status::OK();
518
2.27k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
2.32k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
2.32k
    auto local_state = LocalStateType::create_unique(state, this);
515
2.32k
    RETURN_IF_ERROR(local_state->init(state, info));
516
2.32k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
2.32k
    return Status::OK();
518
2.32k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
461
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
461
    auto local_state = LocalStateType::create_unique(state, this);
515
461
    RETURN_IF_ERROR(local_state->init(state, info));
516
461
    state->emplace_local_state(operator_id(), std::move(local_state));
517
461
    return Status::OK();
518
461
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
2.32k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
2.32k
    auto local_state = LocalStateType::create_unique(state, this);
515
2.32k
    RETURN_IF_ERROR(local_state->init(state, info));
516
2.32k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
2.32k
    return Status::OK();
518
2.32k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
5.91k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
5.91k
    auto local_state = LocalStateType::create_unique(state, this);
515
5.91k
    RETURN_IF_ERROR(local_state->init(state, info));
516
5.91k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
5.91k
    return Status::OK();
518
5.91k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
691k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
691k
    auto local_state = LocalStateType::create_unique(state, this);
515
691k
    RETURN_IF_ERROR(local_state->init(state, info));
516
691k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
691k
    return Status::OK();
518
691k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
14
    auto local_state = LocalStateType::create_unique(state, this);
515
14
    RETURN_IF_ERROR(local_state->init(state, info));
516
14
    state->emplace_local_state(operator_id(), std::move(local_state));
517
14
    return Status::OK();
518
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
151
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
151
    auto local_state = LocalStateType::create_unique(state, this);
515
151
    RETURN_IF_ERROR(local_state->init(state, info));
516
151
    state->emplace_local_state(operator_id(), std::move(local_state));
517
151
    return Status::OK();
518
151
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
1.95k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
1.95k
    auto local_state = LocalStateType::create_unique(state, this);
515
1.95k
    RETURN_IF_ERROR(local_state->init(state, info));
516
1.95k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
1.95k
    return Status::OK();
518
1.95k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
1.60k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
1.60k
    auto local_state = LocalStateType::create_unique(state, this);
515
1.60k
    RETURN_IF_ERROR(local_state->init(state, info));
516
1.60k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
1.60k
    return Status::OK();
518
1.60k
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
2.14k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
2.14k
    auto local_state = LocalStateType::create_unique(state, this);
515
2.14k
    RETURN_IF_ERROR(local_state->init(state, info));
516
2.14k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
2.14k
    return Status::OK();
518
2.14k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
11.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
11.8k
    auto local_state = LocalStateType::create_unique(state, this);
515
11.8k
    RETURN_IF_ERROR(local_state->init(state, info));
516
11.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
11.8k
    return Status::OK();
518
11.8k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
513
398k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
514
398k
    auto local_state = LocalStateType::create_unique(state, this);
515
398k
    RETURN_IF_ERROR(local_state->init(state, info));
516
398k
    state->emplace_local_state(operator_id(), std::move(local_state));
517
398k
    return Status::OK();
518
398k
}
519
520
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
521
                                                         RuntimeState* state)
522
1.98M
        : _parent(parent), _state(state) {}
523
524
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
525
2.43M
        : _num_rows_returned(0), _rows_returned_counter(nullptr), _parent(parent), _state(state) {}
526
527
template <typename SharedStateArg>
528
2.43M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
2.43M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
2.43M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
2.43M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
2.43M
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
2.43M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
2.43M
    _operator_profile->add_child(_common_profile.get(), true);
537
2.43M
    _operator_profile->add_child(_custom_profile.get(), true);
538
2.43M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
2.43M
    if constexpr (!is_fake_shared) {
540
1.28M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
709k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
709k
                                    .first.get()
543
709k
                                    ->template cast<SharedStateArg>();
544
545
709k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
709k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
709k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
709k
        } else if (info.shared_state) {
549
519k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
0
                DCHECK(false);
551
0
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
519k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
519k
            _dependency = _shared_state->create_source_dependency(
556
519k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
519k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
519k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
519k
        } else {
560
59.6k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
2.00k
                DCHECK(false);
562
2.00k
            }
563
59.6k
        }
564
1.28M
    }
565
566
2.43M
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
2.43M
    _rows_returned_counter =
571
2.43M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
2.43M
    _blocks_returned_counter =
573
2.43M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
2.43M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
2.43M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
2.43M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
2.43M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
2.43M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
2.43M
    _memory_used_counter =
580
2.43M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
2.43M
    _common_profile->add_info_string("IsColocate",
582
2.43M
                                     std::to_string(_parent->is_colocated_operator()));
583
2.43M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
2.43M
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
2.43M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
2.43M
    return Status::OK();
587
2.43M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
97.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
97.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
97.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
97.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
97.4k
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
97.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
97.4k
    _operator_profile->add_child(_common_profile.get(), true);
537
97.4k
    _operator_profile->add_child(_custom_profile.get(), true);
538
97.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
97.4k
    if constexpr (!is_fake_shared) {
540
97.4k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
21.3k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
21.3k
                                    .first.get()
543
21.3k
                                    ->template cast<SharedStateArg>();
544
545
21.3k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
21.3k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
21.3k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
76.1k
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
75.2k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
75.2k
            _dependency = _shared_state->create_source_dependency(
556
75.2k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
75.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
75.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
75.2k
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
928
        }
564
97.4k
    }
565
566
97.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
97.4k
    _rows_returned_counter =
571
97.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
97.4k
    _blocks_returned_counter =
573
97.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
97.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
97.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
97.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
97.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
97.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
97.4k
    _memory_used_counter =
580
97.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
97.4k
    _common_profile->add_info_string("IsColocate",
582
97.4k
                                     std::to_string(_parent->is_colocated_operator()));
583
97.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
97.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
97.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
97.4k
    return Status::OK();
587
97.4k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
1
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
1
    _operator_profile->add_child(_common_profile.get(), true);
537
1
    _operator_profile->add_child(_custom_profile.get(), true);
538
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
1
    if constexpr (!is_fake_shared) {
540
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
1
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
1
            _dependency = _shared_state->create_source_dependency(
556
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
1
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
0
        }
564
1
    }
565
566
1
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
1
    _rows_returned_counter =
571
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
1
    _blocks_returned_counter =
573
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
1
    _memory_used_counter =
580
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
1
    _common_profile->add_info_string("IsColocate",
582
1
                                     std::to_string(_parent->is_colocated_operator()));
583
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
1
    return Status::OK();
587
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
278k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
278k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
278k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
278k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
278k
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
278k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
278k
    _operator_profile->add_child(_common_profile.get(), true);
537
278k
    _operator_profile->add_child(_custom_profile.get(), true);
538
278k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
278k
    if constexpr (!is_fake_shared) {
540
278k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
278k
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
273k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
273k
            _dependency = _shared_state->create_source_dependency(
556
273k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
273k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
273k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
273k
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
4.89k
        }
564
278k
    }
565
566
278k
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
278k
    _rows_returned_counter =
571
278k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
278k
    _blocks_returned_counter =
573
278k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
278k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
278k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
278k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
278k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
278k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
278k
    _memory_used_counter =
580
278k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
278k
    _common_profile->add_info_string("IsColocate",
582
278k
                                     std::to_string(_parent->is_colocated_operator()));
583
278k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
278k
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
278k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
278k
    return Status::OK();
587
278k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
25
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
25
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
25
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
25
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
25
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
25
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
25
    _operator_profile->add_child(_common_profile.get(), true);
537
25
    _operator_profile->add_child(_custom_profile.get(), true);
538
25
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
25
    if constexpr (!is_fake_shared) {
540
25
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
25
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
25
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
25
            _dependency = _shared_state->create_source_dependency(
556
25
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
25
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
25
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
25
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
0
        }
564
25
    }
565
566
25
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
25
    _rows_returned_counter =
571
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
25
    _blocks_returned_counter =
573
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
25
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
25
    _memory_used_counter =
580
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
25
    _common_profile->add_info_string("IsColocate",
582
25
                                     std::to_string(_parent->is_colocated_operator()));
583
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
25
    return Status::OK();
587
25
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
8.84k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
8.84k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
8.84k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
8.84k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
8.84k
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
8.84k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
8.84k
    _operator_profile->add_child(_common_profile.get(), true);
537
8.84k
    _operator_profile->add_child(_custom_profile.get(), true);
538
8.84k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
8.84k
    if constexpr (!is_fake_shared) {
540
8.84k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
8.84k
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
8.82k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
8.82k
            _dependency = _shared_state->create_source_dependency(
556
8.82k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
8.82k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
8.82k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
8.82k
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
14
        }
564
8.84k
    }
565
566
8.84k
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
8.84k
    _rows_returned_counter =
571
8.84k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
8.84k
    _blocks_returned_counter =
573
8.84k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
8.84k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
8.84k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
8.84k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
8.84k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
8.84k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
8.84k
    _memory_used_counter =
580
8.84k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
8.84k
    _common_profile->add_info_string("IsColocate",
582
8.84k
                                     std::to_string(_parent->is_colocated_operator()));
583
8.84k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
8.84k
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
8.84k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
8.84k
    return Status::OK();
587
8.84k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
8.95k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
8.95k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
8.95k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
8.95k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
8.95k
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
8.95k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
8.95k
    _operator_profile->add_child(_common_profile.get(), true);
537
8.95k
    _operator_profile->add_child(_custom_profile.get(), true);
538
8.95k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
8.95k
    if constexpr (!is_fake_shared) {
540
8.95k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
8.95k
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
8.94k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
8.94k
            _dependency = _shared_state->create_source_dependency(
556
8.94k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
8.94k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
8.94k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
8.94k
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
4
        }
564
8.95k
    }
565
566
8.95k
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
8.95k
    _rows_returned_counter =
571
8.95k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
8.95k
    _blocks_returned_counter =
573
8.95k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
8.95k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
8.95k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
8.95k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
8.95k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
8.95k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
8.95k
    _memory_used_counter =
580
8.95k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
8.95k
    _common_profile->add_info_string("IsColocate",
582
8.95k
                                     std::to_string(_parent->is_colocated_operator()));
583
8.95k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
8.95k
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
8.95k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
8.95k
    return Status::OK();
587
8.95k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
136k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
136k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
136k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
136k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
136k
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
136k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
136k
    _operator_profile->add_child(_common_profile.get(), true);
537
136k
    _operator_profile->add_child(_custom_profile.get(), true);
538
136k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
136k
    if constexpr (!is_fake_shared) {
540
136k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
136k
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
134k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
134k
            _dependency = _shared_state->create_source_dependency(
556
134k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
134k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
134k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
134k
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
1.13k
        }
564
136k
    }
565
566
136k
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
136k
    _rows_returned_counter =
571
136k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
136k
    _blocks_returned_counter =
573
136k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
136k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
136k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
136k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
136k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
136k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
136k
    _memory_used_counter =
580
136k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
136k
    _common_profile->add_info_string("IsColocate",
582
136k
                                     std::to_string(_parent->is_colocated_operator()));
583
136k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
136k
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
136k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
136k
    return Status::OK();
587
136k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
140
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
140
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
140
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
140
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
140
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
140
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
140
    _operator_profile->add_child(_common_profile.get(), true);
537
140
    _operator_profile->add_child(_custom_profile.get(), true);
538
140
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
140
    if constexpr (!is_fake_shared) {
540
140
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
140
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
140
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
140
            _dependency = _shared_state->create_source_dependency(
556
140
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
140
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
140
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
140
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
0
        }
564
140
    }
565
566
140
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
140
    _rows_returned_counter =
571
140
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
140
    _blocks_returned_counter =
573
140
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
140
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
140
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
140
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
140
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
140
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
140
    _memory_used_counter =
580
140
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
140
    _common_profile->add_info_string("IsColocate",
582
140
                                     std::to_string(_parent->is_colocated_operator()));
583
140
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
140
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
140
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
140
    return Status::OK();
587
140
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
1.14M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
1.14M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
1.14M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
1.14M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
1.14M
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
1.14M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
1.14M
    _operator_profile->add_child(_common_profile.get(), true);
537
1.14M
    _operator_profile->add_child(_custom_profile.get(), true);
538
1.14M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
    if constexpr (!is_fake_shared) {
540
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
                                    .first.get()
543
                                    ->template cast<SharedStateArg>();
544
545
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
            _dependency = _shared_state->create_source_dependency(
556
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
        }
564
    }
565
566
1.14M
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
1.14M
    _rows_returned_counter =
571
1.14M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
1.14M
    _blocks_returned_counter =
573
1.14M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
1.14M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
1.14M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
1.14M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
1.14M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
1.14M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
1.14M
    _memory_used_counter =
580
1.14M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
1.14M
    _common_profile->add_info_string("IsColocate",
582
1.14M
                                     std::to_string(_parent->is_colocated_operator()));
583
1.14M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
1.14M
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
1.14M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
1.14M
    return Status::OK();
587
1.14M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
54.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
54.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
54.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
54.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
54.0k
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
54.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
54.0k
    _operator_profile->add_child(_common_profile.get(), true);
537
54.0k
    _operator_profile->add_child(_custom_profile.get(), true);
538
54.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
54.0k
    if constexpr (!is_fake_shared) {
540
54.0k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
54.0k
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
3.83k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
3.83k
            _dependency = _shared_state->create_source_dependency(
556
3.83k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
3.83k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
3.83k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
50.2k
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
50.2k
        }
564
54.0k
    }
565
566
54.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
54.0k
    _rows_returned_counter =
571
54.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
54.0k
    _blocks_returned_counter =
573
54.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
54.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
54.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
54.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
54.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
54.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
54.0k
    _memory_used_counter =
580
54.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
54.0k
    _common_profile->add_info_string("IsColocate",
582
54.0k
                                     std::to_string(_parent->is_colocated_operator()));
583
54.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
54.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
54.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
54.0k
    return Status::OK();
587
54.0k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
17
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
17
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
17
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
17
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
17
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
17
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
17
    _operator_profile->add_child(_common_profile.get(), true);
537
17
    _operator_profile->add_child(_custom_profile.get(), true);
538
17
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
17
    if constexpr (!is_fake_shared) {
540
17
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
17
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
17
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
17
            _dependency = _shared_state->create_source_dependency(
556
17
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
17
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
17
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
17
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
0
        }
564
17
    }
565
566
17
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
17
    _rows_returned_counter =
571
17
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
17
    _blocks_returned_counter =
573
17
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
17
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
17
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
17
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
17
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
17
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
17
    _memory_used_counter =
580
17
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
17
    _common_profile->add_info_string("IsColocate",
582
17
                                     std::to_string(_parent->is_colocated_operator()));
583
17
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
17
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
17
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
17
    return Status::OK();
587
17
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
9.09k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
9.09k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
9.09k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
9.09k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
9.09k
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
9.09k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
9.09k
    _operator_profile->add_child(_common_profile.get(), true);
537
9.09k
    _operator_profile->add_child(_custom_profile.get(), true);
538
9.09k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
9.09k
    if constexpr (!is_fake_shared) {
540
9.09k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
9.09k
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
9.07k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
9.07k
            _dependency = _shared_state->create_source_dependency(
556
9.07k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
9.07k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
9.07k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
9.07k
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
23
        }
564
9.09k
    }
565
566
9.09k
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
9.09k
    _rows_returned_counter =
571
9.09k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
9.09k
    _blocks_returned_counter =
573
9.09k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
9.09k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
9.09k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
9.09k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
9.09k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
9.09k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
9.09k
    _memory_used_counter =
580
9.09k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
9.09k
    _common_profile->add_info_string("IsColocate",
582
9.09k
                                     std::to_string(_parent->is_colocated_operator()));
583
9.09k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
9.09k
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
9.09k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
9.09k
    return Status::OK();
587
9.09k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
438
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
438
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
438
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
438
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
438
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
438
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
438
    _operator_profile->add_child(_common_profile.get(), true);
537
438
    _operator_profile->add_child(_custom_profile.get(), true);
538
438
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
438
    if constexpr (!is_fake_shared) {
540
438
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
438
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
438
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
438
            _dependency = _shared_state->create_source_dependency(
556
438
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
438
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
438
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
438
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
0
        }
564
438
    }
565
566
438
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
438
    _rows_returned_counter =
571
438
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
438
    _blocks_returned_counter =
573
438
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
438
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
438
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
438
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
438
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
438
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
438
    _memory_used_counter =
580
438
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
438
    _common_profile->add_info_string("IsColocate",
582
438
                                     std::to_string(_parent->is_colocated_operator()));
583
438
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
438
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
438
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
438
    return Status::OK();
587
438
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
4.72k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
4.72k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
4.72k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
4.72k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
4.72k
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
4.72k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
4.72k
    _operator_profile->add_child(_common_profile.get(), true);
537
4.72k
    _operator_profile->add_child(_custom_profile.get(), true);
538
4.72k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
4.72k
    if constexpr (!is_fake_shared) {
540
4.72k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
4.72k
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
4.33k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
4.33k
            _dependency = _shared_state->create_source_dependency(
556
4.33k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
4.33k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
4.33k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
4.33k
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
390
        }
564
4.72k
    }
565
566
4.72k
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
4.72k
    _rows_returned_counter =
571
4.72k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
4.72k
    _blocks_returned_counter =
573
4.72k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
4.72k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
4.72k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
4.72k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
4.72k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
4.72k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
4.72k
    _memory_used_counter =
580
4.72k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
4.72k
    _common_profile->add_info_string("IsColocate",
582
4.72k
                                     std::to_string(_parent->is_colocated_operator()));
583
4.72k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
4.72k
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
4.72k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
4.72k
    return Status::OK();
587
4.72k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
690k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
690k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
690k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
690k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
690k
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
690k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
690k
    _operator_profile->add_child(_common_profile.get(), true);
537
690k
    _operator_profile->add_child(_custom_profile.get(), true);
538
690k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
690k
    if constexpr (!is_fake_shared) {
540
690k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
688k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
688k
                                    .first.get()
543
688k
                                    ->template cast<SharedStateArg>();
544
545
688k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
688k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
688k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
688k
        } else if (info.shared_state) {
549
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
0
                DCHECK(false);
551
0
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
0
            _dependency = _shared_state->create_source_dependency(
556
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
2.00k
        } else {
560
2.00k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
2.00k
                DCHECK(false);
562
2.00k
            }
563
2.00k
        }
564
690k
    }
565
566
690k
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
690k
    _rows_returned_counter =
571
690k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
690k
    _blocks_returned_counter =
573
690k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
690k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
690k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
690k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
690k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
690k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
690k
    _memory_used_counter =
580
690k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
690k
    _common_profile->add_info_string("IsColocate",
582
690k
                                     std::to_string(_parent->is_colocated_operator()));
583
690k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
690k
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
690k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
690k
    return Status::OK();
587
690k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
528
151
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
529
151
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
530
151
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
531
151
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
532
151
    _operator_profile->set_metadata(_parent->node_id());
533
    // indent is false so that source operator will have same
534
    // indentation_level with its parent operator.
535
151
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
536
151
    _operator_profile->add_child(_common_profile.get(), true);
537
151
    _operator_profile->add_child(_custom_profile.get(), true);
538
151
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
539
151
    if constexpr (!is_fake_shared) {
540
151
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
541
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
542
0
                                    .first.get()
543
0
                                    ->template cast<SharedStateArg>();
544
545
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
546
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
547
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
548
151
        } else if (info.shared_state) {
549
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
550
                DCHECK(false);
551
            }
552
            // For UnionSourceOperator without children, there is no shared state.
553
150
            _shared_state = info.shared_state->template cast<SharedStateArg>();
554
555
150
            _dependency = _shared_state->create_source_dependency(
556
150
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
557
150
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
558
150
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
559
150
        } else {
560
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
561
                DCHECK(false);
562
            }
563
1
        }
564
151
    }
565
566
151
    if (must_set_shared_state() && _shared_state == nullptr) {
567
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
568
0
    }
569
570
151
    _rows_returned_counter =
571
151
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
572
151
    _blocks_returned_counter =
573
151
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
574
151
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
575
151
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
576
151
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
577
151
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
578
151
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
579
151
    _memory_used_counter =
580
151
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
581
151
    _common_profile->add_info_string("IsColocate",
582
151
                                     std::to_string(_parent->is_colocated_operator()));
583
151
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
584
151
    _common_profile->add_info_string("FollowedByShuffledOperator",
585
151
                                     std::to_string(_parent->followed_by_shuffled_operator()));
586
151
    return Status::OK();
587
151
}
588
589
template <typename SharedStateArg>
590
2.45M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
2.45M
    _conjuncts.resize(_parent->_conjuncts.size());
592
2.45M
    _projections.resize(_parent->_projections.size());
593
2.94M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
494k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
494k
    }
596
5.28M
    for (size_t i = 0; i < _projections.size(); i++) {
597
2.83M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
2.83M
    }
599
2.45M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
2.45M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
5.92k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
43.7k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
37.8k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
37.8k
                    state, _intermediate_projections[i][j]));
605
37.8k
        }
606
5.92k
    }
607
2.45M
    return Status::OK();
608
2.45M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
97.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
97.8k
    _conjuncts.resize(_parent->_conjuncts.size());
592
97.8k
    _projections.resize(_parent->_projections.size());
593
98.9k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
1.09k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
1.09k
    }
596
488k
    for (size_t i = 0; i < _projections.size(); i++) {
597
391k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
391k
    }
599
97.8k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
99.0k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
1.23k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
14.2k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
13.0k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
13.0k
                    state, _intermediate_projections[i][j]));
605
13.0k
        }
606
1.23k
    }
607
97.8k
    return Status::OK();
608
97.8k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
3
    _conjuncts.resize(_parent->_conjuncts.size());
592
3
    _projections.resize(_parent->_projections.size());
593
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
0
    }
596
3
    for (size_t i = 0; i < _projections.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
0
    }
599
3
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
3
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
0
                    state, _intermediate_projections[i][j]));
605
0
        }
606
0
    }
607
3
    return Status::OK();
608
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
279k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
279k
    _conjuncts.resize(_parent->_conjuncts.size());
592
279k
    _projections.resize(_parent->_projections.size());
593
279k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
0
    }
596
280k
    for (size_t i = 0; i < _projections.size(); i++) {
597
354
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
354
    }
599
279k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
279k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
0
                    state, _intermediate_projections[i][j]));
605
0
        }
606
0
    }
607
279k
    return Status::OK();
608
279k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
24
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
24
    _conjuncts.resize(_parent->_conjuncts.size());
592
24
    _projections.resize(_parent->_projections.size());
593
24
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
0
    }
596
24
    for (size_t i = 0; i < _projections.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
0
    }
599
24
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
24
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
0
                    state, _intermediate_projections[i][j]));
605
0
        }
606
0
    }
607
24
    return Status::OK();
608
24
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
8.86k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
8.86k
    _conjuncts.resize(_parent->_conjuncts.size());
592
8.86k
    _projections.resize(_parent->_projections.size());
593
8.93k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
65
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
65
    }
596
53.6k
    for (size_t i = 0; i < _projections.size(); i++) {
597
44.7k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
44.7k
    }
599
8.86k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
9.00k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
140
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
894
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
754
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
754
                    state, _intermediate_projections[i][j]));
605
754
        }
606
140
    }
607
8.86k
    return Status::OK();
608
8.86k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
8.97k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
8.97k
    _conjuncts.resize(_parent->_conjuncts.size());
592
8.97k
    _projections.resize(_parent->_projections.size());
593
9.96k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
985
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
985
    }
596
24.1k
    for (size_t i = 0; i < _projections.size(); i++) {
597
15.1k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
15.1k
    }
599
8.97k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
9.08k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
112
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
874
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
762
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
762
                    state, _intermediate_projections[i][j]));
605
762
        }
606
112
    }
607
8.97k
    return Status::OK();
608
8.97k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
136k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
136k
    _conjuncts.resize(_parent->_conjuncts.size());
592
136k
    _projections.resize(_parent->_projections.size());
593
140k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
4.13k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
4.13k
    }
596
401k
    for (size_t i = 0; i < _projections.size(); i++) {
597
265k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
265k
    }
599
136k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
136k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
210
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
1.48k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
1.27k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
1.27k
                    state, _intermediate_projections[i][j]));
605
1.27k
        }
606
210
    }
607
136k
    return Status::OK();
608
136k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
144
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
144
    _conjuncts.resize(_parent->_conjuncts.size());
592
144
    _projections.resize(_parent->_projections.size());
593
144
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
0
    }
596
300
    for (size_t i = 0; i < _projections.size(); i++) {
597
156
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
156
    }
599
144
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
144
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
0
                    state, _intermediate_projections[i][j]));
605
0
        }
606
0
    }
607
144
    return Status::OK();
608
144
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
1.15M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
1.15M
    _conjuncts.resize(_parent->_conjuncts.size());
592
1.15M
    _projections.resize(_parent->_projections.size());
593
1.63M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
484k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
484k
    }
596
3.17M
    for (size_t i = 0; i < _projections.size(); i++) {
597
2.02M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
2.02M
    }
599
1.15M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
1.15M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
4.22k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
26.2k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
22.0k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
22.0k
                    state, _intermediate_projections[i][j]));
605
22.0k
        }
606
4.22k
    }
607
1.15M
    return Status::OK();
608
1.15M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
54.4k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
54.4k
    _conjuncts.resize(_parent->_conjuncts.size());
592
54.4k
    _projections.resize(_parent->_projections.size());
593
54.4k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
0
    }
596
146k
    for (size_t i = 0; i < _projections.size(); i++) {
597
92.3k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
92.3k
    }
599
54.4k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
54.4k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
0
                    state, _intermediate_projections[i][j]));
605
0
        }
606
0
    }
607
54.4k
    return Status::OK();
608
54.4k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
17
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
17
    _conjuncts.resize(_parent->_conjuncts.size());
592
17
    _projections.resize(_parent->_projections.size());
593
17
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
0
    }
596
17
    for (size_t i = 0; i < _projections.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
0
    }
599
17
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
17
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
0
                    state, _intermediate_projections[i][j]));
605
0
        }
606
0
    }
607
17
    return Status::OK();
608
17
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
9.09k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
9.09k
    _conjuncts.resize(_parent->_conjuncts.size());
592
9.09k
    _projections.resize(_parent->_projections.size());
593
12.6k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
3.50k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
3.50k
    }
596
9.09k
    for (size_t i = 0; i < _projections.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
0
    }
599
9.09k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
9.09k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
0
                    state, _intermediate_projections[i][j]));
605
0
        }
606
0
    }
607
9.09k
    return Status::OK();
608
9.09k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
438
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
438
    _conjuncts.resize(_parent->_conjuncts.size());
592
438
    _projections.resize(_parent->_projections.size());
593
438
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
0
    }
596
438
    for (size_t i = 0; i < _projections.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
0
    }
599
438
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
438
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
0
                    state, _intermediate_projections[i][j]));
605
0
        }
606
0
    }
607
438
    return Status::OK();
608
438
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
4.83k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
4.83k
    _conjuncts.resize(_parent->_conjuncts.size());
592
4.83k
    _projections.resize(_parent->_projections.size());
593
4.83k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
0
    }
596
4.83k
    for (size_t i = 0; i < _projections.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
0
    }
599
4.83k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
4.83k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
0
                    state, _intermediate_projections[i][j]));
605
0
        }
606
0
    }
607
4.83k
    return Status::OK();
608
4.83k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
696k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
696k
    _conjuncts.resize(_parent->_conjuncts.size());
592
696k
    _projections.resize(_parent->_projections.size());
593
696k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
0
    }
596
696k
    for (size_t i = 0; i < _projections.size(); i++) {
597
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
0
    }
599
696k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
696k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
0
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
0
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
0
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
0
                    state, _intermediate_projections[i][j]));
605
0
        }
606
0
    }
607
696k
    return Status::OK();
608
696k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
590
151
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
591
151
    _conjuncts.resize(_parent->_conjuncts.size());
592
151
    _projections.resize(_parent->_projections.size());
593
158
    for (size_t i = 0; i < _conjuncts.size(); i++) {
594
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
595
7
    }
596
447
    for (size_t i = 0; i < _projections.size(); i++) {
597
296
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
598
296
    }
599
151
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
600
152
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
601
1
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
602
3
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
603
2
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
604
2
                    state, _intermediate_projections[i][j]));
605
2
        }
606
1
    }
607
151
    return Status::OK();
608
151
}
609
610
template <typename SharedStateArg>
611
8.73k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
8.73k
    if (_terminated) {
613
2
        return Status::OK();
614
2
    }
615
8.72k
    _terminated = true;
616
8.72k
    return Status::OK();
617
8.73k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
611
1.25k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
1.25k
    if (_terminated) {
613
0
        return Status::OK();
614
0
    }
615
1.25k
    _terminated = true;
616
1.25k
    return Status::OK();
617
1.25k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
611
125
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
125
    if (_terminated) {
613
0
        return Status::OK();
614
0
    }
615
125
    _terminated = true;
616
125
    return Status::OK();
617
125
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
611
215
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
215
    if (_terminated) {
613
0
        return Status::OK();
614
0
    }
615
215
    _terminated = true;
616
215
    return Status::OK();
617
215
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
611
151
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
151
    if (_terminated) {
613
0
        return Status::OK();
614
0
    }
615
151
    _terminated = true;
616
151
    return Status::OK();
617
151
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
611
5.54k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
5.54k
    if (_terminated) {
613
1
        return Status::OK();
614
1
    }
615
5.54k
    _terminated = true;
616
5.54k
    return Status::OK();
617
5.54k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
611
12
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
12
    if (_terminated) {
613
0
        return Status::OK();
614
0
    }
615
12
    _terminated = true;
616
12
    return Status::OK();
617
12
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
611
13
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
13
    if (_terminated) {
613
0
        return Status::OK();
614
0
    }
615
13
    _terminated = true;
616
13
    return Status::OK();
617
13
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
611
354
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
354
    if (_terminated) {
613
0
        return Status::OK();
614
0
    }
615
354
    _terminated = true;
616
354
    return Status::OK();
617
354
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
611
1.04k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
1.04k
    if (_terminated) {
613
1
        return Status::OK();
614
1
    }
615
1.04k
    _terminated = true;
616
1.04k
    return Status::OK();
617
1.04k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
611
16
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
612
16
    if (_terminated) {
613
0
        return Status::OK();
614
0
    }
615
16
    _terminated = true;
616
16
    return Status::OK();
617
16
}
618
619
template <typename SharedStateArg>
620
2.76M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
2.76M
    if (_closed) {
622
312k
        return Status::OK();
623
312k
    }
624
2.45M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
1.29M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
1.29M
    }
627
2.45M
    _closed = true;
628
2.45M
    return Status::OK();
629
2.76M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
97.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
97.8k
    if (_closed) {
622
0
        return Status::OK();
623
0
    }
624
97.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
97.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
97.8k
    }
627
97.8k
    _closed = true;
628
97.8k
    return Status::OK();
629
97.8k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
3
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
3
    if (_closed) {
622
0
        return Status::OK();
623
0
    }
624
3
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
3
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
3
    }
627
3
    _closed = true;
628
3
    return Status::OK();
629
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
556k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
556k
    if (_closed) {
622
278k
        return Status::OK();
623
278k
    }
624
278k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
278k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
278k
    }
627
278k
    _closed = true;
628
278k
    return Status::OK();
629
556k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
25
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
25
    if (_closed) {
622
0
        return Status::OK();
623
0
    }
624
25
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
25
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
25
    }
627
25
    _closed = true;
628
25
    return Status::OK();
629
25
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
8.86k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
8.86k
    if (_closed) {
622
0
        return Status::OK();
623
0
    }
624
8.86k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
8.86k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
8.86k
    }
627
8.86k
    _closed = true;
628
8.86k
    return Status::OK();
629
8.86k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
18.0k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
18.0k
    if (_closed) {
622
9.12k
        return Status::OK();
623
9.12k
    }
624
8.96k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
8.96k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
8.96k
    }
627
8.96k
    _closed = true;
628
8.96k
    return Status::OK();
629
18.0k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
136k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
136k
    if (_closed) {
622
0
        return Status::OK();
623
0
    }
624
136k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
136k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
136k
    }
627
136k
    _closed = true;
628
136k
    return Status::OK();
629
136k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
139
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
139
    if (_closed) {
622
0
        return Status::OK();
623
0
    }
624
139
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
139
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
139
    }
627
139
    _closed = true;
628
139
    return Status::OK();
629
139
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
1.17M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
1.17M
    if (_closed) {
622
19.0k
        return Status::OK();
623
19.0k
    }
624
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
    }
627
1.15M
    _closed = true;
628
1.15M
    return Status::OK();
629
1.17M
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
54.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
54.4k
    if (_closed) {
622
0
        return Status::OK();
623
0
    }
624
54.4k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
54.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
54.4k
    }
627
54.4k
    _closed = true;
628
54.4k
    return Status::OK();
629
54.4k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
28
    if (_closed) {
622
14
        return Status::OK();
623
14
    }
624
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
14
    }
627
14
    _closed = true;
628
14
    return Status::OK();
629
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
9.08k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
9.08k
    if (_closed) {
622
0
        return Status::OK();
623
0
    }
624
9.08k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
9.08k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
9.08k
    }
627
9.08k
    _closed = true;
628
9.08k
    return Status::OK();
629
9.08k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
670
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
670
    if (_closed) {
622
335
        return Status::OK();
623
335
    }
624
335
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
335
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
335
    }
627
335
    _closed = true;
628
335
    return Status::OK();
629
670
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
9.74k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
9.74k
    if (_closed) {
622
4.92k
        return Status::OK();
623
4.92k
    }
624
4.82k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
4.82k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
4.82k
    }
627
4.82k
    _closed = true;
628
4.82k
    return Status::OK();
629
9.74k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
697k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
697k
    if (_closed) {
622
0
        return Status::OK();
623
0
    }
624
697k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
697k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
697k
    }
627
697k
    _closed = true;
628
697k
    return Status::OK();
629
697k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
620
304
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
621
304
    if (_closed) {
622
162
        return Status::OK();
623
162
    }
624
142
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
625
142
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
626
142
    }
627
142
    _closed = true;
628
142
    return Status::OK();
629
304
}
630
631
template <typename SharedState>
632
1.98M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
1.98M
    _operator_profile =
635
1.98M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
1.98M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
1.98M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
1.98M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
1.98M
    _operator_profile->add_child(_common_profile, true);
644
1.98M
    _operator_profile->add_child(_custom_profile, true);
645
646
1.98M
    _operator_profile->set_metadata(_parent->node_id());
647
1.98M
    _wait_for_finish_dependency_timer =
648
1.98M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
1.98M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
1.98M
    if constexpr (!is_fake_shared) {
651
1.33M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
1.33M
            info.shared_state_map.end()) {
653
292k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
269k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
269k
            }
656
292k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
292k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
292k
                                                  ? 0
659
292k
                                                  : info.task_idx]
660
292k
                                  .get();
661
292k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
1.04M
        } else {
663
1.04M
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
341
                DCHECK(false);
665
341
            }
666
1.04M
            _shared_state = info.shared_state->template cast<SharedState>();
667
1.04M
            _dependency = _shared_state->create_sink_dependency(
668
1.04M
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
1.04M
        }
670
1.33M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
1.33M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
1.33M
    }
673
674
1.98M
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
1.98M
    _rows_input_counter =
679
1.98M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
1.98M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
1.98M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
1.98M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
1.98M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
1.98M
    _memory_used_counter =
685
1.98M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
1.98M
    _common_profile->add_info_string("IsColocate",
687
1.98M
                                     std::to_string(_parent->is_colocated_operator()));
688
1.98M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
1.98M
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
1.98M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
1.98M
    return Status::OK();
692
1.98M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
145k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
145k
    _operator_profile =
635
145k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
145k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
145k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
145k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
145k
    _operator_profile->add_child(_common_profile, true);
644
145k
    _operator_profile->add_child(_custom_profile, true);
645
646
145k
    _operator_profile->set_metadata(_parent->node_id());
647
145k
    _wait_for_finish_dependency_timer =
648
145k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
145k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
145k
    if constexpr (!is_fake_shared) {
651
145k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
145k
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
21.5k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
21.5k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
21.5k
                                                  ? 0
659
21.5k
                                                  : info.task_idx]
660
21.5k
                                  .get();
661
21.5k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
124k
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
124k
            _shared_state = info.shared_state->template cast<SharedState>();
667
124k
            _dependency = _shared_state->create_sink_dependency(
668
124k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
124k
        }
670
145k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
145k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
145k
    }
673
674
145k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
145k
    _rows_input_counter =
679
145k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
145k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
145k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
145k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
145k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
145k
    _memory_used_counter =
685
145k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
145k
    _common_profile->add_info_string("IsColocate",
687
145k
                                     std::to_string(_parent->is_colocated_operator()));
688
145k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
145k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
145k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
145k
    return Status::OK();
692
145k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
2
    _operator_profile =
635
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
2
    _operator_profile->add_child(_common_profile, true);
644
2
    _operator_profile->add_child(_custom_profile, true);
645
646
2
    _operator_profile->set_metadata(_parent->node_id());
647
2
    _wait_for_finish_dependency_timer =
648
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
2
    if constexpr (!is_fake_shared) {
651
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
2
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
2
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
2
            _shared_state = info.shared_state->template cast<SharedState>();
667
2
            _dependency = _shared_state->create_sink_dependency(
668
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
2
        }
670
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
2
    }
673
674
2
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
2
    _rows_input_counter =
679
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
2
    _memory_used_counter =
685
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
2
    _common_profile->add_info_string("IsColocate",
687
2
                                     std::to_string(_parent->is_colocated_operator()));
688
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
2
    return Status::OK();
692
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
279k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
279k
    _operator_profile =
635
279k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
279k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
279k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
279k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
279k
    _operator_profile->add_child(_common_profile, true);
644
279k
    _operator_profile->add_child(_custom_profile, true);
645
646
279k
    _operator_profile->set_metadata(_parent->node_id());
647
279k
    _wait_for_finish_dependency_timer =
648
279k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
279k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
279k
    if constexpr (!is_fake_shared) {
651
279k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
279k
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
279k
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
279k
            _shared_state = info.shared_state->template cast<SharedState>();
667
279k
            _dependency = _shared_state->create_sink_dependency(
668
279k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
279k
        }
670
279k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
279k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
279k
    }
673
674
279k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
279k
    _rows_input_counter =
679
279k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
279k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
279k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
279k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
279k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
279k
    _memory_used_counter =
685
279k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
279k
    _common_profile->add_info_string("IsColocate",
687
279k
                                     std::to_string(_parent->is_colocated_operator()));
688
279k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
279k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
279k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
279k
    return Status::OK();
692
279k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
31
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
31
    _operator_profile =
635
31
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
31
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
31
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
31
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
31
    _operator_profile->add_child(_common_profile, true);
644
31
    _operator_profile->add_child(_custom_profile, true);
645
646
31
    _operator_profile->set_metadata(_parent->node_id());
647
31
    _wait_for_finish_dependency_timer =
648
31
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
31
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
31
    if constexpr (!is_fake_shared) {
651
31
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
31
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
31
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
31
            _shared_state = info.shared_state->template cast<SharedState>();
667
31
            _dependency = _shared_state->create_sink_dependency(
668
31
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
31
        }
670
31
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
31
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
31
    }
673
674
31
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
31
    _rows_input_counter =
679
31
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
31
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
31
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
31
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
31
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
31
    _memory_used_counter =
685
31
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
31
    _common_profile->add_info_string("IsColocate",
687
31
                                     std::to_string(_parent->is_colocated_operator()));
688
31
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
31
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
31
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
31
    return Status::OK();
692
31
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
8.86k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
8.86k
    _operator_profile =
635
8.86k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
8.86k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
8.86k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
8.86k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
8.86k
    _operator_profile->add_child(_common_profile, true);
644
8.86k
    _operator_profile->add_child(_custom_profile, true);
645
646
8.86k
    _operator_profile->set_metadata(_parent->node_id());
647
8.86k
    _wait_for_finish_dependency_timer =
648
8.86k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
8.86k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
8.86k
    if constexpr (!is_fake_shared) {
651
8.86k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
8.86k
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
8.86k
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
8.86k
            _shared_state = info.shared_state->template cast<SharedState>();
667
8.86k
            _dependency = _shared_state->create_sink_dependency(
668
8.86k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
8.86k
        }
670
8.86k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
8.86k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
8.86k
    }
673
674
8.86k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
8.86k
    _rows_input_counter =
679
8.86k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
8.86k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
8.86k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
8.86k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
8.86k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
8.86k
    _memory_used_counter =
685
8.86k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
8.86k
    _common_profile->add_info_string("IsColocate",
687
8.86k
                                     std::to_string(_parent->is_colocated_operator()));
688
8.86k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
8.86k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
8.86k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
8.86k
    return Status::OK();
692
8.86k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
8.97k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
8.97k
    _operator_profile =
635
8.97k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
8.97k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
8.97k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
8.97k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
8.97k
    _operator_profile->add_child(_common_profile, true);
644
8.97k
    _operator_profile->add_child(_custom_profile, true);
645
646
8.97k
    _operator_profile->set_metadata(_parent->node_id());
647
8.97k
    _wait_for_finish_dependency_timer =
648
8.97k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
8.97k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
8.97k
    if constexpr (!is_fake_shared) {
651
8.97k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
8.97k
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
8.97k
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
8.97k
            _shared_state = info.shared_state->template cast<SharedState>();
667
8.97k
            _dependency = _shared_state->create_sink_dependency(
668
8.97k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
8.97k
        }
670
8.97k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
8.97k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
8.97k
    }
673
674
8.97k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
8.97k
    _rows_input_counter =
679
8.97k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
8.97k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
8.97k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
8.97k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
8.97k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
8.97k
    _memory_used_counter =
685
8.97k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
8.97k
    _common_profile->add_info_string("IsColocate",
687
8.97k
                                     std::to_string(_parent->is_colocated_operator()));
688
8.97k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
8.97k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
8.97k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
8.97k
    return Status::OK();
692
8.97k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
136k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
136k
    _operator_profile =
635
136k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
136k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
136k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
136k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
136k
    _operator_profile->add_child(_common_profile, true);
644
136k
    _operator_profile->add_child(_custom_profile, true);
645
646
136k
    _operator_profile->set_metadata(_parent->node_id());
647
136k
    _wait_for_finish_dependency_timer =
648
136k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
136k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
136k
    if constexpr (!is_fake_shared) {
651
136k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
136k
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
136k
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
136k
            _shared_state = info.shared_state->template cast<SharedState>();
667
136k
            _dependency = _shared_state->create_sink_dependency(
668
136k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
136k
        }
670
136k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
136k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
136k
    }
673
674
136k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
136k
    _rows_input_counter =
679
136k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
136k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
136k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
136k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
136k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
136k
    _memory_used_counter =
685
136k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
136k
    _common_profile->add_info_string("IsColocate",
687
136k
                                     std::to_string(_parent->is_colocated_operator()));
688
136k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
136k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
136k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
136k
    return Status::OK();
692
136k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
150
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
150
    _operator_profile =
635
150
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
150
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
150
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
150
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
150
    _operator_profile->add_child(_common_profile, true);
644
150
    _operator_profile->add_child(_custom_profile, true);
645
646
150
    _operator_profile->set_metadata(_parent->node_id());
647
150
    _wait_for_finish_dependency_timer =
648
150
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
150
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
150
    if constexpr (!is_fake_shared) {
651
150
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
150
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
150
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
150
            _shared_state = info.shared_state->template cast<SharedState>();
667
150
            _dependency = _shared_state->create_sink_dependency(
668
150
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
150
        }
670
150
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
150
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
150
    }
673
674
150
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
150
    _rows_input_counter =
679
150
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
150
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
150
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
150
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
150
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
150
    _memory_used_counter =
685
150
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
150
    _common_profile->add_info_string("IsColocate",
687
150
                                     std::to_string(_parent->is_colocated_operator()));
688
150
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
150
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
150
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
150
    return Status::OK();
692
150
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
650k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
650k
    _operator_profile =
635
650k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
650k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
650k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
650k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
650k
    _operator_profile->add_child(_common_profile, true);
644
650k
    _operator_profile->add_child(_custom_profile, true);
645
646
650k
    _operator_profile->set_metadata(_parent->node_id());
647
650k
    _wait_for_finish_dependency_timer =
648
650k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
650k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
    if constexpr (!is_fake_shared) {
651
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
                                                  ? 0
659
                                                  : info.task_idx]
660
                                  .get();
661
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
            _shared_state = info.shared_state->template cast<SharedState>();
667
            _dependency = _shared_state->create_sink_dependency(
668
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
        }
670
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
    }
673
674
650k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
650k
    _rows_input_counter =
679
650k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
650k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
650k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
650k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
650k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
650k
    _memory_used_counter =
685
650k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
650k
    _common_profile->add_info_string("IsColocate",
687
650k
                                     std::to_string(_parent->is_colocated_operator()));
688
650k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
650k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
650k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
650k
    return Status::OK();
692
650k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
8.01k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
8.01k
    _operator_profile =
635
8.01k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
8.01k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
8.01k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
8.01k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
8.01k
    _operator_profile->add_child(_common_profile, true);
644
8.01k
    _operator_profile->add_child(_custom_profile, true);
645
646
8.01k
    _operator_profile->set_metadata(_parent->node_id());
647
8.01k
    _wait_for_finish_dependency_timer =
648
8.01k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
8.01k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
8.01k
    if constexpr (!is_fake_shared) {
651
8.01k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
8.01k
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
8.01k
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
8.01k
            _shared_state = info.shared_state->template cast<SharedState>();
667
8.01k
            _dependency = _shared_state->create_sink_dependency(
668
8.01k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
8.01k
        }
670
8.01k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
8.01k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
8.01k
    }
673
674
8.01k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
8.01k
    _rows_input_counter =
679
8.01k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
8.01k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
8.01k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
8.01k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
8.01k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
8.01k
    _memory_used_counter =
685
8.01k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
8.01k
    _common_profile->add_info_string("IsColocate",
687
8.01k
                                     std::to_string(_parent->is_colocated_operator()));
688
8.01k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
8.01k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
8.01k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
8.01k
    return Status::OK();
692
8.01k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
438
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
438
    _operator_profile =
635
438
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
438
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
438
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
438
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
438
    _operator_profile->add_child(_common_profile, true);
644
438
    _operator_profile->add_child(_custom_profile, true);
645
646
438
    _operator_profile->set_metadata(_parent->node_id());
647
438
    _wait_for_finish_dependency_timer =
648
438
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
438
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
438
    if constexpr (!is_fake_shared) {
651
438
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
438
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
438
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
438
            _shared_state = info.shared_state->template cast<SharedState>();
667
438
            _dependency = _shared_state->create_sink_dependency(
668
438
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
438
        }
670
438
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
438
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
438
    }
673
674
438
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
438
    _rows_input_counter =
679
438
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
438
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
438
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
438
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
438
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
438
    _memory_used_counter =
685
438
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
438
    _common_profile->add_info_string("IsColocate",
687
438
                                     std::to_string(_parent->is_colocated_operator()));
688
438
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
438
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
438
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
438
    return Status::OK();
692
438
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
3.22k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
3.22k
    _operator_profile =
635
3.22k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
3.22k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
3.22k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
3.22k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
3.22k
    _operator_profile->add_child(_common_profile, true);
644
3.22k
    _operator_profile->add_child(_custom_profile, true);
645
646
3.22k
    _operator_profile->set_metadata(_parent->node_id());
647
3.22k
    _wait_for_finish_dependency_timer =
648
3.22k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
3.22k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
3.22k
    if constexpr (!is_fake_shared) {
651
3.22k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
3.22k
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
3.22k
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
3.22k
            _shared_state = info.shared_state->template cast<SharedState>();
667
3.22k
            _dependency = _shared_state->create_sink_dependency(
668
3.22k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
3.22k
        }
670
3.22k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
3.22k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
3.22k
    }
673
674
3.22k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
3.22k
    _rows_input_counter =
679
3.22k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
3.22k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
3.22k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
3.22k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
3.22k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
3.22k
    _memory_used_counter =
685
3.22k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
3.22k
    _common_profile->add_info_string("IsColocate",
687
3.22k
                                     std::to_string(_parent->is_colocated_operator()));
688
3.22k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
3.22k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
3.22k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
3.22k
    return Status::OK();
692
3.22k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
11.8k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
11.8k
    _operator_profile =
635
11.8k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
11.8k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
11.8k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
11.8k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
11.8k
    _operator_profile->add_child(_common_profile, true);
644
11.8k
    _operator_profile->add_child(_custom_profile, true);
645
646
11.8k
    _operator_profile->set_metadata(_parent->node_id());
647
11.8k
    _wait_for_finish_dependency_timer =
648
11.8k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
11.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
11.8k
    if constexpr (!is_fake_shared) {
651
11.8k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
11.8k
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
11.8k
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
11.8k
            _shared_state = info.shared_state->template cast<SharedState>();
667
11.8k
            _dependency = _shared_state->create_sink_dependency(
668
11.8k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
11.8k
        }
670
11.8k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
11.8k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
11.8k
    }
673
674
11.8k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
11.8k
    _rows_input_counter =
679
11.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
11.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
11.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
11.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
11.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
11.8k
    _memory_used_counter =
685
11.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
11.8k
    _common_profile->add_info_string("IsColocate",
687
11.8k
                                     std::to_string(_parent->is_colocated_operator()));
688
11.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
11.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
11.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
11.8k
    return Status::OK();
692
11.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
269k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
269k
    _operator_profile =
635
269k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
269k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
269k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
269k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
269k
    _operator_profile->add_child(_common_profile, true);
644
269k
    _operator_profile->add_child(_custom_profile, true);
645
646
269k
    _operator_profile->set_metadata(_parent->node_id());
647
269k
    _wait_for_finish_dependency_timer =
648
269k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
269k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
269k
    if constexpr (!is_fake_shared) {
651
269k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
269k
            info.shared_state_map.end()) {
653
269k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
269k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
269k
            }
656
269k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
269k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
269k
                                                  ? 0
659
269k
                                                  : info.task_idx]
660
269k
                                  .get();
661
269k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
269k
        } else {
663
341
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
341
                DCHECK(false);
665
341
            }
666
341
            _shared_state = info.shared_state->template cast<SharedState>();
667
341
            _dependency = _shared_state->create_sink_dependency(
668
341
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
341
        }
670
269k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
269k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
269k
    }
673
674
269k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
269k
    _rows_input_counter =
679
269k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
269k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
269k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
269k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
269k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
269k
    _memory_used_counter =
685
269k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
269k
    _common_profile->add_info_string("IsColocate",
687
269k
                                     std::to_string(_parent->is_colocated_operator()));
688
269k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
269k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
269k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
269k
    return Status::OK();
692
269k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
465k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
465k
    _operator_profile =
635
465k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
465k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
465k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
465k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
465k
    _operator_profile->add_child(_common_profile, true);
644
465k
    _operator_profile->add_child(_custom_profile, true);
645
646
465k
    _operator_profile->set_metadata(_parent->node_id());
647
465k
    _wait_for_finish_dependency_timer =
648
465k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
465k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
465k
    if constexpr (!is_fake_shared) {
651
465k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
465k
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
1.58k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
1.58k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
1.58k
                                                  ? 0
659
1.58k
                                                  : info.task_idx]
660
1.58k
                                  .get();
661
1.58k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
464k
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
464k
            _shared_state = info.shared_state->template cast<SharedState>();
667
464k
            _dependency = _shared_state->create_sink_dependency(
668
464k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
464k
        }
670
465k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
465k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
465k
    }
673
674
465k
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
465k
    _rows_input_counter =
679
465k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
465k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
465k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
465k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
465k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
465k
    _memory_used_counter =
685
465k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
465k
    _common_profile->add_info_string("IsColocate",
687
465k
                                     std::to_string(_parent->is_colocated_operator()));
688
465k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
465k
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
465k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
465k
    return Status::OK();
692
465k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
17
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
17
    _operator_profile =
635
17
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
17
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
17
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
17
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
17
    _operator_profile->add_child(_common_profile, true);
644
17
    _operator_profile->add_child(_custom_profile, true);
645
646
17
    _operator_profile->set_metadata(_parent->node_id());
647
17
    _wait_for_finish_dependency_timer =
648
17
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
17
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
17
    if constexpr (!is_fake_shared) {
651
17
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
17
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
17
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
17
            _shared_state = info.shared_state->template cast<SharedState>();
667
17
            _dependency = _shared_state->create_sink_dependency(
668
17
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
17
        }
670
17
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
17
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
17
    }
673
674
17
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
17
    _rows_input_counter =
679
17
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
17
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
17
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
17
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
17
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
17
    _memory_used_counter =
685
17
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
17
    _common_profile->add_info_string("IsColocate",
687
17
                                     std::to_string(_parent->is_colocated_operator()));
688
17
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
17
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
17
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
17
    return Status::OK();
692
17
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
632
302
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
633
    // create profile
634
302
    _operator_profile =
635
302
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
636
302
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
637
302
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
638
639
    // indentation is true
640
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
641
    // So we should set the indentation to true.
642
302
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
643
302
    _operator_profile->add_child(_common_profile, true);
644
302
    _operator_profile->add_child(_custom_profile, true);
645
646
302
    _operator_profile->set_metadata(_parent->node_id());
647
302
    _wait_for_finish_dependency_timer =
648
302
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
649
302
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
650
302
    if constexpr (!is_fake_shared) {
651
302
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
652
302
            info.shared_state_map.end()) {
653
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
654
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
655
            }
656
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
657
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
658
0
                                                  ? 0
659
0
                                                  : info.task_idx]
660
0
                                  .get();
661
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
662
302
        } else {
663
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
664
                DCHECK(false);
665
            }
666
302
            _shared_state = info.shared_state->template cast<SharedState>();
667
302
            _dependency = _shared_state->create_sink_dependency(
668
302
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
669
302
        }
670
302
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
671
302
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
672
302
    }
673
674
302
    if (must_set_shared_state() && _shared_state == nullptr) {
675
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
676
0
    }
677
678
302
    _rows_input_counter =
679
302
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
680
302
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
681
302
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
682
302
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
683
302
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
684
302
    _memory_used_counter =
685
302
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
686
302
    _common_profile->add_info_string("IsColocate",
687
302
                                     std::to_string(_parent->is_colocated_operator()));
688
302
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
689
302
    _common_profile->add_info_string("FollowedByShuffledOperator",
690
302
                                     std::to_string(_parent->followed_by_shuffled_operator()));
691
302
    return Status::OK();
692
302
}
693
694
template <typename SharedState>
695
1.99M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
1.99M
    if (_closed) {
697
2
        return Status::OK();
698
2
    }
699
1.99M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
1.34M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
1.34M
    }
702
1.99M
    _closed = true;
703
1.99M
    return Status::OK();
704
1.99M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
145k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
145k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
145k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
145k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
145k
    }
702
145k
    _closed = true;
703
145k
    return Status::OK();
704
145k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
1
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
1
    }
702
1
    _closed = true;
703
1
    return Status::OK();
704
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
279k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
279k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
279k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
279k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
279k
    }
702
279k
    _closed = true;
703
279k
    return Status::OK();
704
279k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
23
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
23
    if (_closed) {
697
2
        return Status::OK();
698
2
    }
699
21
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
21
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
21
    }
702
21
    _closed = true;
703
21
    return Status::OK();
704
23
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
8.82k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
8.82k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
8.82k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
8.82k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
8.82k
    }
702
8.82k
    _closed = true;
703
8.82k
    return Status::OK();
704
8.82k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
8.95k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
8.95k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
8.95k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
8.95k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
8.95k
    }
702
8.95k
    _closed = true;
703
8.95k
    return Status::OK();
704
8.95k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
135k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
135k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
135k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
135k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
135k
    }
702
135k
    _closed = true;
703
135k
    return Status::OK();
704
135k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
139
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
139
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
139
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
139
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
139
    }
702
139
    _closed = true;
703
139
    return Status::OK();
704
139
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
650k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
650k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
    }
702
650k
    _closed = true;
703
650k
    return Status::OK();
704
650k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
8.02k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
8.02k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
8.02k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
8.02k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
8.02k
    }
702
8.02k
    _closed = true;
703
8.02k
    return Status::OK();
704
8.02k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
331
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
331
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
331
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
331
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
331
    }
702
331
    _closed = true;
703
331
    return Status::OK();
704
331
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
3.23k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
3.23k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
3.23k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
3.23k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
3.23k
    }
702
3.23k
    _closed = true;
703
3.23k
    return Status::OK();
704
3.23k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
11.9k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
11.9k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
11.9k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
11.9k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
11.9k
    }
702
11.9k
    _closed = true;
703
11.9k
    return Status::OK();
704
11.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
270k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
270k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
270k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
270k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
270k
    }
702
270k
    _closed = true;
703
270k
    return Status::OK();
704
270k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
469k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
469k
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
469k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
469k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
469k
    }
702
469k
    _closed = true;
703
469k
    return Status::OK();
704
469k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
14
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
14
    }
702
14
    _closed = true;
703
14
    return Status::OK();
704
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
695
302
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
696
302
    if (_closed) {
697
0
        return Status::OK();
698
0
    }
699
302
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
700
302
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
701
302
    }
702
302
    _closed = true;
703
302
    return Status::OK();
704
302
}
705
706
template <typename LocalStateType>
707
6.86k
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
708
6.86k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
709
6.85k
    return pull(state, block, eos);
710
6.86k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
707
432
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
708
432
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
709
432
    return pull(state, block, eos);
710
432
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
707
6.42k
Status StreamingOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
708
6.42k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
709
6.42k
    return pull(state, block, eos);
710
6.42k
}
711
712
template <typename LocalStateType>
713
688k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
714
688k
    auto& local_state = get_local_state(state);
715
688k
    if (need_more_input_data(state)) {
716
640k
        local_state._child_block->clear_column_data(
717
640k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
718
640k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
719
640k
                state, local_state._child_block.get(), &local_state._child_eos));
720
640k
        *eos = local_state._child_eos;
721
640k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
722
59.9k
            return Status::OK();
723
59.9k
        }
724
580k
        {
725
580k
            SCOPED_TIMER(local_state.exec_time_counter());
726
580k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
727
580k
        }
728
580k
    }
729
730
629k
    if (!need_more_input_data(state)) {
731
581k
        SCOPED_TIMER(local_state.exec_time_counter());
732
581k
        bool new_eos = false;
733
581k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
734
581k
        if (new_eos) {
735
501k
            *eos = true;
736
501k
        } else if (!need_more_input_data(state)) {
737
25.0k
            *eos = false;
738
25.0k
        }
739
581k
    }
740
629k
    return Status::OK();
741
629k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
713
155k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
714
155k
    auto& local_state = get_local_state(state);
715
155k
    if (need_more_input_data(state)) {
716
121k
        local_state._child_block->clear_column_data(
717
121k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
718
121k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
719
121k
                state, local_state._child_block.get(), &local_state._child_eos));
720
121k
        *eos = local_state._child_eos;
721
121k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
722
29.6k
            return Status::OK();
723
29.6k
        }
724
91.6k
        {
725
91.6k
            SCOPED_TIMER(local_state.exec_time_counter());
726
91.6k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
727
91.6k
        }
728
91.6k
    }
729
730
126k
    if (!need_more_input_data(state)) {
731
126k
        SCOPED_TIMER(local_state.exec_time_counter());
732
126k
        bool new_eos = false;
733
126k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
734
126k
        if (new_eos) {
735
73.5k
            *eos = true;
736
73.5k
        } else if (!need_more_input_data(state)) {
737
10.0k
            *eos = false;
738
10.0k
        }
739
126k
    }
740
126k
    return Status::OK();
741
126k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
713
3.15k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
714
3.15k
    auto& local_state = get_local_state(state);
715
3.15k
    if (need_more_input_data(state)) {
716
1.91k
        local_state._child_block->clear_column_data(
717
1.91k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
718
1.91k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
719
1.91k
                state, local_state._child_block.get(), &local_state._child_eos));
720
1.91k
        *eos = local_state._child_eos;
721
1.91k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
722
308
            return Status::OK();
723
308
        }
724
1.61k
        {
725
1.61k
            SCOPED_TIMER(local_state.exec_time_counter());
726
1.61k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
727
1.61k
        }
728
1.61k
    }
729
730
2.85k
    if (!need_more_input_data(state)) {
731
2.85k
        SCOPED_TIMER(local_state.exec_time_counter());
732
2.85k
        bool new_eos = false;
733
2.85k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
734
2.85k
        if (new_eos) {
735
1.26k
            *eos = true;
736
1.58k
        } else if (!need_more_input_data(state)) {
737
1.23k
            *eos = false;
738
1.23k
        }
739
2.85k
    }
740
2.84k
    return Status::OK();
741
2.84k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
713
4.48k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
714
4.48k
    auto& local_state = get_local_state(state);
715
4.48k
    if (need_more_input_data(state)) {
716
4.48k
        local_state._child_block->clear_column_data(
717
4.48k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
718
4.48k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
719
4.48k
                state, local_state._child_block.get(), &local_state._child_eos));
720
4.48k
        *eos = local_state._child_eos;
721
4.48k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
722
1.57k
            return Status::OK();
723
1.57k
        }
724
2.91k
        {
725
2.91k
            SCOPED_TIMER(local_state.exec_time_counter());
726
2.91k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
727
2.91k
        }
728
2.91k
    }
729
730
2.91k
    if (!need_more_input_data(state)) {
731
2.91k
        SCOPED_TIMER(local_state.exec_time_counter());
732
2.91k
        bool new_eos = false;
733
2.91k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
734
2.91k
        if (new_eos) {
735
1.60k
            *eos = true;
736
1.60k
        } else if (!need_more_input_data(state)) {
737
0
            *eos = false;
738
0
        }
739
2.91k
    }
740
2.91k
    return Status::OK();
741
2.91k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
713
33.9k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
714
33.9k
    auto& local_state = get_local_state(state);
715
33.9k
    if (need_more_input_data(state)) {
716
33.9k
        local_state._child_block->clear_column_data(
717
33.9k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
718
33.9k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
719
33.9k
                state, local_state._child_block.get(), &local_state._child_eos));
720
33.9k
        *eos = local_state._child_eos;
721
33.9k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
722
7.48k
            return Status::OK();
723
7.48k
        }
724
26.4k
        {
725
26.4k
            SCOPED_TIMER(local_state.exec_time_counter());
726
26.4k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
727
26.4k
        }
728
26.4k
    }
729
730
26.4k
    if (!need_more_input_data(state)) {
731
11.8k
        SCOPED_TIMER(local_state.exec_time_counter());
732
11.8k
        bool new_eos = false;
733
11.8k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
734
11.8k
        if (new_eos) {
735
11.7k
            *eos = true;
736
11.7k
        } else if (!need_more_input_data(state)) {
737
10
            *eos = false;
738
10
        }
739
11.8k
    }
740
26.4k
    return Status::OK();
741
26.4k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
713
449k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
714
449k
    auto& local_state = get_local_state(state);
715
450k
    if (need_more_input_data(state)) {
716
450k
        local_state._child_block->clear_column_data(
717
450k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
718
450k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
719
450k
                state, local_state._child_block.get(), &local_state._child_eos));
720
450k
        *eos = local_state._child_eos;
721
450k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
722
17.4k
            return Status::OK();
723
17.4k
        }
724
432k
        {
725
432k
            SCOPED_TIMER(local_state.exec_time_counter());
726
432k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
727
432k
        }
728
432k
    }
729
730
432k
    if (!need_more_input_data(state)) {
731
400k
        SCOPED_TIMER(local_state.exec_time_counter());
732
400k
        bool new_eos = false;
733
400k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
734
400k
        if (new_eos) {
735
399k
            *eos = true;
736
399k
        } else if (!need_more_input_data(state)) {
737
0
            *eos = false;
738
0
        }
739
400k
    }
740
432k
    return Status::OK();
741
432k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
713
34.5k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
714
34.5k
    auto& local_state = get_local_state(state);
715
34.5k
    if (need_more_input_data(state)) {
716
21.1k
        local_state._child_block->clear_column_data(
717
21.1k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
718
21.1k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
719
21.1k
                state, local_state._child_block.get(), &local_state._child_eos));
720
21.1k
        *eos = local_state._child_eos;
721
21.1k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
722
2.98k
            return Status::OK();
723
2.98k
        }
724
18.1k
        {
725
18.1k
            SCOPED_TIMER(local_state.exec_time_counter());
726
18.1k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
727
18.1k
        }
728
18.1k
    }
729
730
31.6k
    if (!need_more_input_data(state)) {
731
30.8k
        SCOPED_TIMER(local_state.exec_time_counter());
732
30.8k
        bool new_eos = false;
733
30.8k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
734
30.8k
        if (new_eos) {
735
8.85k
            *eos = true;
736
21.9k
        } else if (!need_more_input_data(state)) {
737
13.4k
            *eos = false;
738
13.4k
        }
739
30.8k
    }
740
31.6k
    return Status::OK();
741
31.6k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE9get_blockEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
713
7.40k
Status StatefulOperatorX<LocalStateType>::get_block(RuntimeState* state, Block* block, bool* eos) {
714
7.40k
    auto& local_state = get_local_state(state);
715
7.40k
    if (need_more_input_data(state)) {
716
7.05k
        local_state._child_block->clear_column_data(
717
7.05k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
718
7.05k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
719
7.05k
                state, local_state._child_block.get(), &local_state._child_eos));
720
7.05k
        *eos = local_state._child_eos;
721
7.05k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
722
438
            return Status::OK();
723
438
        }
724
6.61k
        {
725
6.61k
            SCOPED_TIMER(local_state.exec_time_counter());
726
6.61k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
727
6.61k
        }
728
6.61k
    }
729
730
6.96k
    if (!need_more_input_data(state)) {
731
6.96k
        SCOPED_TIMER(local_state.exec_time_counter());
732
6.96k
        bool new_eos = false;
733
6.96k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
734
6.96k
        if (new_eos) {
735
4.96k
            *eos = true;
736
4.96k
        } else if (!need_more_input_data(state)) {
737
366
            *eos = false;
738
366
        }
739
6.96k
    }
740
6.96k
    return Status::OK();
741
6.96k
}
742
743
template <typename Writer, typename Parent>
744
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
745
67.4k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
746
67.4k
    RETURN_IF_ERROR(Base::init(state, info));
747
67.4k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
748
67.4k
                                                         "AsyncWriterDependency", true);
749
67.4k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
750
67.4k
                             _finish_dependency));
751
752
67.4k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
753
67.4k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
754
67.4k
    return Status::OK();
755
67.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
745
518
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
746
518
    RETURN_IF_ERROR(Base::init(state, info));
747
518
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
748
518
                                                         "AsyncWriterDependency", true);
749
518
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
750
518
                             _finish_dependency));
751
752
518
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
753
518
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
754
518
    return Status::OK();
755
518
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
745
80
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
746
80
    RETURN_IF_ERROR(Base::init(state, info));
747
80
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
748
80
                                                         "AsyncWriterDependency", true);
749
80
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
750
80
                             _finish_dependency));
751
752
80
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
753
80
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
754
80
    return Status::OK();
755
80
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
745
51.8k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
746
51.8k
    RETURN_IF_ERROR(Base::init(state, info));
747
51.8k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
748
51.8k
                                                         "AsyncWriterDependency", true);
749
51.8k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
750
51.8k
                             _finish_dependency));
751
752
51.8k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
753
51.8k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
754
51.8k
    return Status::OK();
755
51.8k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
745
5.51k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
746
5.51k
    RETURN_IF_ERROR(Base::init(state, info));
747
5.51k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
748
5.51k
                                                         "AsyncWriterDependency", true);
749
5.51k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
750
5.51k
                             _finish_dependency));
751
752
5.51k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
753
5.51k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
754
5.51k
    return Status::OK();
755
5.51k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
745
5.14k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
746
5.14k
    RETURN_IF_ERROR(Base::init(state, info));
747
5.14k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
748
5.14k
                                                         "AsyncWriterDependency", true);
749
5.14k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
750
5.14k
                             _finish_dependency));
751
752
5.14k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
753
5.14k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
754
5.14k
    return Status::OK();
755
5.14k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
745
3.38k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
746
3.38k
    RETURN_IF_ERROR(Base::init(state, info));
747
3.38k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
748
3.38k
                                                         "AsyncWriterDependency", true);
749
3.38k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
750
3.38k
                             _finish_dependency));
751
752
3.38k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
753
3.38k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
754
3.38k
    return Status::OK();
755
3.38k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
745
160
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
746
160
    RETURN_IF_ERROR(Base::init(state, info));
747
160
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
748
160
                                                         "AsyncWriterDependency", true);
749
160
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
750
160
                             _finish_dependency));
751
752
160
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
753
160
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
754
160
    return Status::OK();
755
160
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
745
640
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
746
640
    RETURN_IF_ERROR(Base::init(state, info));
747
640
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
748
640
                                                         "AsyncWriterDependency", true);
749
640
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
750
640
                             _finish_dependency));
751
752
640
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
753
640
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
754
640
    return Status::OK();
755
640
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
745
156
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
746
156
    RETURN_IF_ERROR(Base::init(state, info));
747
156
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
748
156
                                                         "AsyncWriterDependency", true);
749
156
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
750
156
                             _finish_dependency));
751
752
156
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
753
156
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
754
156
    return Status::OK();
755
156
}
756
757
template <typename Writer, typename Parent>
758
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
759
67.8k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
760
67.8k
    RETURN_IF_ERROR(Base::open(state));
761
67.8k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
762
613k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
763
546k
        RETURN_IF_ERROR(
764
546k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
765
546k
    }
766
67.8k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
767
67.8k
    return Status::OK();
768
67.8k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
759
518
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
760
518
    RETURN_IF_ERROR(Base::open(state));
761
518
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
762
2.78k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
763
2.26k
        RETURN_IF_ERROR(
764
2.26k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
765
2.26k
    }
766
518
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
767
518
    return Status::OK();
768
518
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
759
80
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
760
80
    RETURN_IF_ERROR(Base::open(state));
761
80
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
762
388
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
763
308
        RETURN_IF_ERROR(
764
308
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
765
308
    }
766
80
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
767
80
    return Status::OK();
768
80
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
759
52.2k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
760
52.2k
    RETURN_IF_ERROR(Base::open(state));
761
52.2k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
762
386k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
763
334k
        RETURN_IF_ERROR(
764
334k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
765
334k
    }
766
52.2k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
767
52.2k
    return Status::OK();
768
52.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
759
5.48k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
760
5.48k
    RETURN_IF_ERROR(Base::open(state));
761
5.48k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
762
38.9k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
763
33.4k
        RETURN_IF_ERROR(
764
33.4k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
765
33.4k
    }
766
5.48k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
767
5.48k
    return Status::OK();
768
5.48k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
759
5.14k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
760
5.14k
    RETURN_IF_ERROR(Base::open(state));
761
5.14k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
762
137k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
763
132k
        RETURN_IF_ERROR(
764
132k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
765
132k
    }
766
5.14k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
767
5.14k
    return Status::OK();
768
5.14k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
759
3.38k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
760
3.38k
    RETURN_IF_ERROR(Base::open(state));
761
3.38k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
762
42.3k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
763
38.9k
        RETURN_IF_ERROR(
764
38.9k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
765
38.9k
    }
766
3.38k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
767
3.38k
    return Status::OK();
768
3.38k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
759
160
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
760
160
    RETURN_IF_ERROR(Base::open(state));
761
160
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
762
480
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
763
320
        RETURN_IF_ERROR(
764
320
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
765
320
    }
766
160
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
767
160
    return Status::OK();
768
160
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
759
640
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
760
640
    RETURN_IF_ERROR(Base::open(state));
761
640
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
762
4.37k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
763
3.73k
        RETURN_IF_ERROR(
764
3.73k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
765
3.73k
    }
766
640
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
767
640
    return Status::OK();
768
640
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
759
156
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
760
156
    RETURN_IF_ERROR(Base::open(state));
761
156
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
762
786
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
763
630
        RETURN_IF_ERROR(
764
630
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
765
630
    }
766
156
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
767
156
    return Status::OK();
768
156
}
769
770
template <typename Writer, typename Parent>
771
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
772
88.2k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
773
88.2k
    return _writer->sink(block, eos);
774
88.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
772
2.62k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
773
2.62k
    return _writer->sink(block, eos);
774
2.62k
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
772
104
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
773
104
    return _writer->sink(block, eos);
774
104
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
772
64.9k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
773
64.9k
    return _writer->sink(block, eos);
774
64.9k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
772
6.52k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
773
6.52k
    return _writer->sink(block, eos);
774
6.52k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
772
7.49k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
773
7.49k
    return _writer->sink(block, eos);
774
7.49k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
772
5.31k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
773
5.31k
    return _writer->sink(block, eos);
774
5.31k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
772
180
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
773
180
    return _writer->sink(block, eos);
774
180
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
772
794
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
773
794
    return _writer->sink(block, eos);
774
794
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
772
306
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
773
306
    return _writer->sink(block, eos);
774
306
}
775
776
template <typename Writer, typename Parent>
777
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
778
67.9k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
779
67.9k
    if (_closed) {
780
0
        return Status::OK();
781
0
    }
782
67.9k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
783
67.9k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
784
    // if the init failed, the _writer may be nullptr. so here need check
785
68.0k
    if (_writer) {
786
68.0k
        Status st = _writer->get_writer_status();
787
68.0k
        if (exec_status.ok()) {
788
67.9k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
789
67.9k
                                                       : Status::Cancelled("force close"));
790
67.9k
        } else {
791
53
            _writer->force_close(exec_status);
792
53
        }
793
        // If there is an error in process_block thread, then we should get the writer
794
        // status before call force_close. For example, the thread may failed in commit
795
        // transaction.
796
68.0k
        RETURN_IF_ERROR(st);
797
68.0k
    }
798
67.9k
    return Base::close(state, exec_status);
799
67.9k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
778
506
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
779
506
    if (_closed) {
780
0
        return Status::OK();
781
0
    }
782
506
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
783
506
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
784
    // if the init failed, the _writer may be nullptr. so here need check
785
506
    if (_writer) {
786
506
        Status st = _writer->get_writer_status();
787
506
        if (exec_status.ok()) {
788
506
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
789
506
                                                       : Status::Cancelled("force close"));
790
506
        } else {
791
0
            _writer->force_close(exec_status);
792
0
        }
793
        // If there is an error in process_block thread, then we should get the writer
794
        // status before call force_close. For example, the thread may failed in commit
795
        // transaction.
796
506
        RETURN_IF_ERROR(st);
797
506
    }
798
506
    return Base::close(state, exec_status);
799
506
}
_ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
778
80
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
779
80
    if (_closed) {
780
0
        return Status::OK();
781
0
    }
782
80
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
783
80
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
784
    // if the init failed, the _writer may be nullptr. so here need check
785
80
    if (_writer) {
786
80
        Status st = _writer->get_writer_status();
787
80
        if (exec_status.ok()) {
788
80
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
789
80
                                                       : Status::Cancelled("force close"));
790
80
        } else {
791
0
            _writer->force_close(exec_status);
792
0
        }
793
        // If there is an error in process_block thread, then we should get the writer
794
        // status before call force_close. For example, the thread may failed in commit
795
        // transaction.
796
80
        RETURN_IF_ERROR(st);
797
80
    }
798
80
    return Base::close(state, exec_status);
799
80
}
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
778
52.4k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
779
52.4k
    if (_closed) {
780
0
        return Status::OK();
781
0
    }
782
52.4k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
783
52.4k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
784
    // if the init failed, the _writer may be nullptr. so here need check
785
52.4k
    if (_writer) {
786
52.4k
        Status st = _writer->get_writer_status();
787
52.4k
        if (exec_status.ok()) {
788
52.4k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
789
52.4k
                                                       : Status::Cancelled("force close"));
790
52.4k
        } else {
791
35
            _writer->force_close(exec_status);
792
35
        }
793
        // If there is an error in process_block thread, then we should get the writer
794
        // status before call force_close. For example, the thread may failed in commit
795
        // transaction.
796
52.4k
        RETURN_IF_ERROR(st);
797
52.4k
    }
798
52.3k
    return Base::close(state, exec_status);
799
52.4k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
778
5.50k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
779
5.50k
    if (_closed) {
780
0
        return Status::OK();
781
0
    }
782
5.50k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
783
5.50k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
784
    // if the init failed, the _writer may be nullptr. so here need check
785
5.51k
    if (_writer) {
786
5.51k
        Status st = _writer->get_writer_status();
787
5.51k
        if (exec_status.ok()) {
788
5.49k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
789
5.49k
                                                       : Status::Cancelled("force close"));
790
5.49k
        } else {
791
16
            _writer->force_close(exec_status);
792
16
        }
793
        // If there is an error in process_block thread, then we should get the writer
794
        // status before call force_close. For example, the thread may failed in commit
795
        // transaction.
796
5.51k
        RETURN_IF_ERROR(st);
797
5.51k
    }
798
5.50k
    return Base::close(state, exec_status);
799
5.50k
}
_ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
778
5.14k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
779
5.14k
    if (_closed) {
780
0
        return Status::OK();
781
0
    }
782
5.14k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
783
5.14k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
784
    // if the init failed, the _writer may be nullptr. so here need check
785
5.14k
    if (_writer) {
786
5.14k
        Status st = _writer->get_writer_status();
787
5.14k
        if (exec_status.ok()) {
788
5.14k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
789
5.14k
                                                       : Status::Cancelled("force close"));
790
5.14k
        } else {
791
2
            _writer->force_close(exec_status);
792
2
        }
793
        // If there is an error in process_block thread, then we should get the writer
794
        // status before call force_close. For example, the thread may failed in commit
795
        // transaction.
796
5.14k
        RETURN_IF_ERROR(st);
797
5.14k
    }
798
5.14k
    return Base::close(state, exec_status);
799
5.14k
}
_ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
778
3.37k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
779
3.37k
    if (_closed) {
780
0
        return Status::OK();
781
0
    }
782
3.37k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
783
3.37k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
784
    // if the init failed, the _writer may be nullptr. so here need check
785
3.37k
    if (_writer) {
786
3.37k
        Status st = _writer->get_writer_status();
787
3.37k
        if (exec_status.ok()) {
788
3.37k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
789
3.37k
                                                       : Status::Cancelled("force close"));
790
3.37k
        } else {
791
0
            _writer->force_close(exec_status);
792
0
        }
793
        // If there is an error in process_block thread, then we should get the writer
794
        // status before call force_close. For example, the thread may failed in commit
795
        // transaction.
796
3.37k
        RETURN_IF_ERROR(st);
797
3.37k
    }
798
3.37k
    return Base::close(state, exec_status);
799
3.37k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
778
158
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
779
158
    if (_closed) {
780
0
        return Status::OK();
781
0
    }
782
158
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
783
158
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
784
    // if the init failed, the _writer may be nullptr. so here need check
785
160
    if (_writer) {
786
160
        Status st = _writer->get_writer_status();
787
160
        if (exec_status.ok()) {
788
160
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
789
160
                                                       : Status::Cancelled("force close"));
790
160
        } else {
791
0
            _writer->force_close(exec_status);
792
0
        }
793
        // If there is an error in process_block thread, then we should get the writer
794
        // status before call force_close. For example, the thread may failed in commit
795
        // transaction.
796
160
        RETURN_IF_ERROR(st);
797
160
    }
798
158
    return Base::close(state, exec_status);
799
158
}
_ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
778
640
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
779
640
    if (_closed) {
780
0
        return Status::OK();
781
0
    }
782
640
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
783
640
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
784
    // if the init failed, the _writer may be nullptr. so here need check
785
640
    if (_writer) {
786
640
        Status st = _writer->get_writer_status();
787
640
        if (exec_status.ok()) {
788
640
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
789
640
                                                       : Status::Cancelled("force close"));
790
640
        } else {
791
0
            _writer->force_close(exec_status);
792
0
        }
793
        // If there is an error in process_block thread, then we should get the writer
794
        // status before call force_close. For example, the thread may failed in commit
795
        // transaction.
796
640
        RETURN_IF_ERROR(st);
797
640
    }
798
640
    return Base::close(state, exec_status);
799
640
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
778
156
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
779
156
    if (_closed) {
780
0
        return Status::OK();
781
0
    }
782
156
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
783
156
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
784
    // if the init failed, the _writer may be nullptr. so here need check
785
156
    if (_writer) {
786
156
        Status st = _writer->get_writer_status();
787
156
        if (exec_status.ok()) {
788
156
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
789
156
                                                       : Status::Cancelled("force close"));
790
156
        } else {
791
0
            _writer->force_close(exec_status);
792
0
        }
793
        // If there is an error in process_block thread, then we should get the writer
794
        // status before call force_close. For example, the thread may failed in commit
795
        // transaction.
796
156
        RETURN_IF_ERROR(st);
797
156
    }
798
156
    return Base::close(state, exec_status);
799
156
}
800
801
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
802
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
803
DECLARE_OPERATOR(ResultSinkLocalState)
804
DECLARE_OPERATOR(JdbcTableSinkLocalState)
805
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
806
DECLARE_OPERATOR(ResultFileSinkLocalState)
807
DECLARE_OPERATOR(OlapTableSinkLocalState)
808
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
809
DECLARE_OPERATOR(HiveTableSinkLocalState)
810
DECLARE_OPERATOR(TVFTableSinkLocalState)
811
DECLARE_OPERATOR(IcebergTableSinkLocalState)
812
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
813
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
814
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
815
DECLARE_OPERATOR(MCTableSinkLocalState)
816
DECLARE_OPERATOR(AnalyticSinkLocalState)
817
DECLARE_OPERATOR(BlackholeSinkLocalState)
818
DECLARE_OPERATOR(SortSinkLocalState)
819
DECLARE_OPERATOR(SpillSortSinkLocalState)
820
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
821
DECLARE_OPERATOR(AggSinkLocalState)
822
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
823
DECLARE_OPERATOR(ExchangeSinkLocalState)
824
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
825
DECLARE_OPERATOR(UnionSinkLocalState)
826
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
827
DECLARE_OPERATOR(PartitionSortSinkLocalState)
828
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
829
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
830
DECLARE_OPERATOR(SetSinkLocalState<true>)
831
DECLARE_OPERATOR(SetSinkLocalState<false>)
832
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
833
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
834
DECLARE_OPERATOR(CacheSinkLocalState)
835
DECLARE_OPERATOR(DictSinkLocalState)
836
DECLARE_OPERATOR(RecCTESinkLocalState)
837
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
838
839
#undef DECLARE_OPERATOR
840
841
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
842
DECLARE_OPERATOR(HashJoinProbeLocalState)
843
DECLARE_OPERATOR(OlapScanLocalState)
844
DECLARE_OPERATOR(GroupCommitLocalState)
845
DECLARE_OPERATOR(JDBCScanLocalState)
846
DECLARE_OPERATOR(FileScanLocalState)
847
DECLARE_OPERATOR(EsScanLocalState)
848
DECLARE_OPERATOR(AnalyticLocalState)
849
DECLARE_OPERATOR(SortLocalState)
850
DECLARE_OPERATOR(SpillSortLocalState)
851
DECLARE_OPERATOR(LocalMergeSortLocalState)
852
DECLARE_OPERATOR(AggLocalState)
853
DECLARE_OPERATOR(PartitionedAggLocalState)
854
DECLARE_OPERATOR(TableFunctionLocalState)
855
DECLARE_OPERATOR(ExchangeLocalState)
856
DECLARE_OPERATOR(RepeatLocalState)
857
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
858
DECLARE_OPERATOR(AssertNumRowsLocalState)
859
DECLARE_OPERATOR(EmptySetLocalState)
860
DECLARE_OPERATOR(UnionSourceLocalState)
861
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
862
DECLARE_OPERATOR(PartitionSortSourceLocalState)
863
DECLARE_OPERATOR(SetSourceLocalState<true>)
864
DECLARE_OPERATOR(SetSourceLocalState<false>)
865
DECLARE_OPERATOR(DataGenLocalState)
866
DECLARE_OPERATOR(SchemaScanLocalState)
867
DECLARE_OPERATOR(MetaScanLocalState)
868
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
869
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
870
DECLARE_OPERATOR(CacheSourceLocalState)
871
DECLARE_OPERATOR(RecCTESourceLocalState)
872
DECLARE_OPERATOR(RecCTEScanLocalState)
873
874
#ifdef BE_TEST
875
DECLARE_OPERATOR(MockLocalState)
876
DECLARE_OPERATOR(MockScanLocalState)
877
#endif
878
#undef DECLARE_OPERATOR
879
880
template class StreamingOperatorX<AssertNumRowsLocalState>;
881
template class StreamingOperatorX<SelectLocalState>;
882
883
template class StatefulOperatorX<HashJoinProbeLocalState>;
884
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
885
template class StatefulOperatorX<RepeatLocalState>;
886
template class StatefulOperatorX<MaterializationLocalState>;
887
template class StatefulOperatorX<StreamingAggLocalState>;
888
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
889
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
890
template class StatefulOperatorX<TableFunctionLocalState>;
891
892
template class PipelineXSinkLocalState<HashJoinSharedState>;
893
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
894
template class PipelineXSinkLocalState<SortSharedState>;
895
template class PipelineXSinkLocalState<SpillSortSharedState>;
896
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
897
template class PipelineXSinkLocalState<AnalyticSharedState>;
898
template class PipelineXSinkLocalState<AggSharedState>;
899
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
900
template class PipelineXSinkLocalState<FakeSharedState>;
901
template class PipelineXSinkLocalState<UnionSharedState>;
902
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
903
template class PipelineXSinkLocalState<MultiCastSharedState>;
904
template class PipelineXSinkLocalState<SetSharedState>;
905
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
906
template class PipelineXSinkLocalState<BasicSharedState>;
907
template class PipelineXSinkLocalState<DataQueueSharedState>;
908
template class PipelineXSinkLocalState<RecCTESharedState>;
909
910
template class PipelineXLocalState<HashJoinSharedState>;
911
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
912
template class PipelineXLocalState<SortSharedState>;
913
template class PipelineXLocalState<SpillSortSharedState>;
914
template class PipelineXLocalState<NestedLoopJoinSharedState>;
915
template class PipelineXLocalState<AnalyticSharedState>;
916
template class PipelineXLocalState<AggSharedState>;
917
template class PipelineXLocalState<PartitionedAggSharedState>;
918
template class PipelineXLocalState<FakeSharedState>;
919
template class PipelineXLocalState<UnionSharedState>;
920
template class PipelineXLocalState<DataQueueSharedState>;
921
template class PipelineXLocalState<MultiCastSharedState>;
922
template class PipelineXLocalState<PartitionSortNodeSharedState>;
923
template class PipelineXLocalState<SetSharedState>;
924
template class PipelineXLocalState<LocalExchangeSharedState>;
925
template class PipelineXLocalState<BasicSharedState>;
926
template class PipelineXLocalState<RecCTESharedState>;
927
928
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
929
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
930
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
931
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
932
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
933
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
934
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
935
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
936
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
937
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
938
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
939
940
#ifdef BE_TEST
941
template class OperatorX<DummyOperatorLocalState>;
942
template class DataSinkOperatorX<DummySinkLocalState>;
943
#endif
944
945
} // namespace doris