Coverage Report

Created: 2026-08-15 01:43

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