Coverage Report

Created: 2026-10-08 23:00

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/paimon_table_sink_operator.h"
68
#include "exec/operator/partition_sort_sink_operator.h"
69
#include "exec/operator/partition_sort_source_operator.h"
70
#include "exec/operator/partitioned_aggregation_sink_operator.h"
71
#include "exec/operator/partitioned_aggregation_source_operator.h"
72
#include "exec/operator/partitioned_hash_join_probe_operator.h"
73
#include "exec/operator/partitioned_hash_join_sink_operator.h"
74
#include "exec/operator/rec_cte_anchor_sink_operator.h"
75
#include "exec/operator/rec_cte_scan_operator.h"
76
#include "exec/operator/rec_cte_sink_operator.h"
77
#include "exec/operator/rec_cte_source_operator.h"
78
#include "exec/operator/repeat_operator.h"
79
#include "exec/operator/result_file_sink_operator.h"
80
#include "exec/operator/result_sink_operator.h"
81
#include "exec/operator/schema_scan_operator.h"
82
#include "exec/operator/select_operator.h"
83
#include "exec/operator/set_probe_sink_operator.h"
84
#include "exec/operator/set_sink_operator.h"
85
#include "exec/operator/set_source_operator.h"
86
#include "exec/operator/sort_sink_operator.h"
87
#include "exec/operator/sort_source_operator.h"
88
#include "exec/operator/spill_iceberg_table_sink_operator.h"
89
#include "exec/operator/spill_sort_sink_operator.h"
90
#include "exec/operator/spill_sort_source_operator.h"
91
#include "exec/operator/streaming_aggregation_operator.h"
92
#include "exec/operator/table_function_operator.h"
93
#include "exec/operator/tvf_table_sink_operator.h"
94
#include "exec/operator/union_sink_operator.h"
95
#include "exec/operator/union_source_operator.h"
96
#include "exec/pipeline/dependency.h"
97
#include "exec/pipeline/pipeline.h"
98
#include "exprs/vexpr.h"
99
#include "exprs/vexpr_context.h"
100
#include "runtime/runtime_profile.h"
101
#include "runtime/runtime_profile_counter_names.h"
102
#include "util/debug_util.h"
103
#include "util/string_util.h"
104
105
namespace doris {
106
class RowDescriptor;
107
class RuntimeState;
108
} // namespace doris
109
110
namespace doris {
111
112
0
Status OperatorBase::close(RuntimeState* state) {
113
0
    if (_is_closed) {
114
0
        return Status::OK();
115
0
    }
116
0
    _is_closed = true;
117
0
    return Status::OK();
118
0
}
119
120
template <typename SharedStateArg>
121
1.66M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
1.66M
    if (_parent->nereids_id() == -1) {
123
863k
        return fmt::format("(id={})", _parent->node_id());
124
863k
    } else {
125
805k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
805k
    }
127
1.66M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
70.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
70.1k
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
70.1k
    } else {
125
70.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
70.1k
    }
127
70.1k
}
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
1
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
1
    if (_parent->nereids_id() == -1) {
123
1
        return fmt::format("(id={})", _parent->node_id());
124
1
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
1
}
_ZNK5doris19PipelineXLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
200k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
200k
    if (_parent->nereids_id() == -1) {
123
12
        return fmt::format("(id={})", _parent->node_id());
124
200k
    } else {
125
200k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
200k
    }
127
200k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
28
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
28
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
28
    } else {
125
28
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
28
    }
127
28
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
6.83k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
6.83k
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
6.83k
    } else {
125
6.83k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
6.83k
    }
127
6.83k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
8.05k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
8.05k
    if (_parent->nereids_id() == -1) {
123
16
        return fmt::format("(id={})", _parent->node_id());
124
8.04k
    } else {
125
8.04k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
8.04k
    }
127
8.05k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
96.4k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
96.4k
    if (_parent->nereids_id() == -1) {
123
29
        return fmt::format("(id={})", _parent->node_id());
124
96.4k
    } else {
125
96.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
96.4k
    }
127
96.4k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
62.6k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
62.6k
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
62.6k
    } else {
125
62.6k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
62.6k
    }
127
62.6k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
181
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
181
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
181
    } else {
125
181
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
181
    }
127
181
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
572k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
572k
    if (_parent->nereids_id() == -1) {
123
271k
        return fmt::format("(id={})", _parent->node_id());
124
300k
    } else {
125
300k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
300k
    }
127
572k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
54.9k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
54.9k
    if (_parent->nereids_id() == -1) {
123
2
        return fmt::format("(id={})", _parent->node_id());
124
54.9k
    } else {
125
54.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
54.9k
    }
127
54.9k
}
_ZNK5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
26
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
26
    if (_parent->nereids_id() == -1) {
123
26
        return fmt::format("(id={})", _parent->node_id());
124
26
    } else {
125
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
0
    }
127
26
}
_ZNK5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
5.95k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
5.95k
    if (_parent->nereids_id() == -1) {
123
5.95k
        return fmt::format("(id={})", _parent->node_id());
124
18.4E
    } else {
125
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
18.4E
    }
127
5.95k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
555
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
555
    if (_parent->nereids_id() == -1) {
123
102
        return fmt::format("(id={})", _parent->node_id());
124
453
    } else {
125
453
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
453
    }
127
555
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
5.13k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
5.13k
    if (_parent->nereids_id() == -1) {
123
13
        return fmt::format("(id={})", _parent->node_id());
124
5.11k
    } else {
125
5.11k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
5.11k
    }
127
5.13k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
584k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
585k
    if (_parent->nereids_id() == -1) {
123
585k
        return fmt::format("(id={})", _parent->node_id());
124
18.4E
    } else {
125
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
18.4E
    }
127
584k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
_ZNK5doris19PipelineXLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
121
169
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
122
169
    if (_parent->nereids_id() == -1) {
123
0
        return fmt::format("(id={})", _parent->node_id());
124
169
    } else {
125
169
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
126
169
    }
127
169
}
128
129
template <typename SharedStateArg>
130
1.15M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
1.15M
    if (_parent->nereids_id() == -1) {
132
649k
        return fmt::format("(id={})", _parent->node_id());
133
649k
    } else {
134
504k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
504k
    }
136
1.15M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
118k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
118k
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
118k
    } else {
134
118k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
118k
    }
136
118k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
2
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
2
    if (_parent->nereids_id() == -1) {
132
1
        return fmt::format("(id={})", _parent->node_id());
133
1
    } else {
134
1
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
1
    }
136
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
202k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
202k
    if (_parent->nereids_id() == -1) {
132
9
        return fmt::format("(id={})", _parent->node_id());
133
202k
    } else {
134
202k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
202k
    }
136
202k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
35
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
35
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
35
    } else {
134
35
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
35
    }
136
35
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
6.86k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
6.86k
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
6.86k
    } else {
134
6.86k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
6.86k
    }
136
6.86k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
8.07k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
8.07k
    if (_parent->nereids_id() == -1) {
132
16
        return fmt::format("(id={})", _parent->node_id());
133
8.06k
    } else {
134
8.06k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
8.06k
    }
136
8.07k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
96.5k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
96.5k
    if (_parent->nereids_id() == -1) {
132
29
        return fmt::format("(id={})", _parent->node_id());
133
96.4k
    } else {
134
96.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
96.4k
    }
136
96.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
62.5k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
62.5k
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
62.5k
    } else {
134
62.5k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
62.5k
    }
136
62.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
189
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
189
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
189
    } else {
134
189
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
189
    }
136
189
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
51
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
51
    if (_parent->nereids_id() == -1) {
132
51
        return fmt::format("(id={})", _parent->node_id());
133
51
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
51
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
8.90k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
8.90k
    if (_parent->nereids_id() == -1) {
132
3
        return fmt::format("(id={})", _parent->node_id());
133
8.89k
    } else {
134
8.89k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
8.89k
    }
136
8.90k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
555
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
555
    if (_parent->nereids_id() == -1) {
132
102
        return fmt::format("(id={})", _parent->node_id());
133
453
    } else {
134
453
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
453
    }
136
555
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
12.9k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
12.9k
    if (_parent->nereids_id() == -1) {
132
12.9k
        return fmt::format("(id={})", _parent->node_id());
133
18.4E
    } else {
134
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
18.4E
    }
136
12.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
230k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
230k
    if (_parent->nereids_id() == -1) {
132
230k
        return fmt::format("(id={})", _parent->node_id());
133
18.4E
    } else {
134
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
18.4E
    }
136
230k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
405k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
405k
    if (_parent->nereids_id() == -1) {
132
405k
        return fmt::format("(id={})", _parent->node_id());
133
18.4E
    } else {
134
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
18.4E
    }
136
405k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
25
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
25
    if (_parent->nereids_id() == -1) {
132
25
        return fmt::format("(id={})", _parent->node_id());
133
25
    } else {
134
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
0
    }
136
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
130
338
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
131
338
    if (_parent->nereids_id() == -1) {
132
0
        return fmt::format("(id={})", _parent->node_id());
133
338
    } else {
134
338
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
135
338
    }
136
338
}
137
138
template <typename SharedStateArg>
139
32.1k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
32.1k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
32.1k
    _terminated = true;
144
32.1k
    return Status::OK();
145
32.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
24.0k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
24.0k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
24.0k
    _terminated = true;
144
24.0k
    return Status::OK();
145
24.0k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
4.16k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
4.16k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
4.16k
    _terminated = true;
144
4.16k
    return Status::OK();
145
4.16k
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
2
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
2
    _terminated = true;
144
2
    return Status::OK();
145
2
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
2
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
2
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
2
    _terminated = true;
144
2
    return Status::OK();
145
2
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
2.11k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
2.11k
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
2.11k
    _terminated = true;
144
2.11k
    return Status::OK();
145
2.11k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
518
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
518
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
518
    _terminated = true;
144
518
    return Status::OK();
145
518
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
505
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
505
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
505
    _terminated = true;
144
505
    return Status::OK();
145
505
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
197
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
197
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
197
    _terminated = true;
144
197
    return Status::OK();
145
197
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
5
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
5
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
5
    _terminated = true;
144
5
    return Status::OK();
145
5
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
161
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
161
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
161
    _terminated = true;
144
161
    return Status::OK();
145
161
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
6
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
6
    _terminated = true;
144
6
    return Status::OK();
145
6
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
340
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
340
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
340
    _terminated = true;
144
340
    return Status::OK();
145
340
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
139
131
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
140
131
    if (_terminated) {
141
0
        return Status::OK();
142
0
    }
143
131
    _terminated = true;
144
131
    return Status::OK();
145
131
}
146
147
323k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
148
323k
    return _child && _child->is_serial_operator() && !is_source()
149
323k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
150
323k
                   : DataDistribution(TLocalPartitionType::NOOP);
151
323k
}
152
153
29.1k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
154
29.1k
    if (!_child) {
155
27.8k
        return false;
156
27.8k
    }
157
1.35k
    if (_child->is_serial_operator()) {
158
199
        return true;
159
199
    }
160
1.15k
    const auto child_distribution = _child->required_data_distribution(state);
161
1.15k
    return child_distribution.need_local_exchange() &&
162
1.15k
           !is_shuffled_exchange(child_distribution.distribution_type);
163
1.35k
}
164
165
template <typename SharedStateArg>
166
16.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
16.6k
    fmt::memory_buffer debug_string_buffer;
168
16.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
16.6k
    return fmt::to_string(debug_string_buffer);
170
16.6k
}
Unexecuted instantiation: _ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE12debug_stringB5cxx11Ei
_ZNK5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
166
3
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
3
    fmt::memory_buffer debug_string_buffer;
168
3
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
3
    return fmt::to_string(debug_string_buffer);
170
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
166
16.6k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
16.6k
    fmt::memory_buffer debug_string_buffer;
168
16.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
16.6k
    return fmt::to_string(debug_string_buffer);
170
16.6k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE12debug_stringB5cxx11Ei
Line
Count
Source
166
1
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
167
1
    fmt::memory_buffer debug_string_buffer;
168
1
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
169
1
    return fmt::to_string(debug_string_buffer);
170
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
171
172
template <typename SharedStateArg>
173
16.6k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
174
16.6k
    fmt::memory_buffer debug_string_buffer;
175
16.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
176
16.6k
    return fmt::to_string(debug_string_buffer);
177
16.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
173
16.6k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
174
16.6k
    fmt::memory_buffer debug_string_buffer;
175
16.6k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
176
16.6k
    return fmt::to_string(debug_string_buffer);
177
16.6k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
178
179
16.7k
std::string OperatorXBase::debug_string(int indentation_level) const {
180
16.7k
    fmt::memory_buffer debug_string_buffer;
181
16.7k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
182
16.7k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
183
16.7k
                   _is_serial_operator);
184
16.7k
    return fmt::to_string(debug_string_buffer);
185
16.7k
}
186
187
16.6k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
188
16.6k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
189
16.6k
}
190
191
702k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
192
702k
    std::string node_name = print_plan_node_type(tnode.node_type);
193
702k
    _nereids_id = tnode.nereids_id;
194
702k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
195
6.47k
        if (!has_projection()) {
196
0
            return Status::InternalError("no final output tuple id");
197
0
        }
198
6.47k
        if (tnode.intermediate_output_tuple_id_list.size() !=
199
6.47k
            tnode.intermediate_projections_list.size()) {
200
0
            return Status::InternalError(
201
0
                    "intermediate_output_tuple_id_list size:{} not match "
202
0
                    "intermediate_projections_list size:{}",
203
0
                    tnode.intermediate_output_tuple_id_list.size(),
204
0
                    tnode.intermediate_projections_list.size());
205
0
        }
206
6.47k
    }
207
702k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
208
702k
    _op_name = substr + "_OPERATOR";
209
210
702k
    if (tnode.__isset.vconjunct) {
211
0
        return Status::InternalError("vconjunct is not supported yet");
212
702k
    } else if (tnode.__isset.conjuncts) {
213
278k
        for (const auto& conjunct : tnode.conjuncts) {
214
278k
            VExprContextSPtr context;
215
278k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
216
278k
            _conjuncts.emplace_back(context);
217
278k
        }
218
102k
    }
219
220
    // create the projections expr
221
702k
    if (tnode.__isset.projections) {
222
272k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projection->projections));
223
272k
    }
224
702k
    if (!tnode.intermediate_projections_list.empty()) {
225
6.48k
        DCHECK(has_projection()) << "no final projections";
226
6.48k
        _projection->intermediate_projections.reserve(tnode.intermediate_projections_list.size());
227
10.9k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
228
10.9k
            VExprContextSPtrs projections;
229
10.9k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
230
10.9k
            _projection->intermediate_projections.push_back(projections);
231
10.9k
        }
232
6.48k
    }
233
702k
    return Status::OK();
234
702k
}
235
236
729k
Status OperatorXBase::prepare(RuntimeState* state) {
237
729k
    for (auto& conjunct : _conjuncts) {
238
278k
        RETURN_IF_ERROR(conjunct->prepare(state, operator_row_desc_before_projection()));
239
278k
    }
240
729k
    if (state->enable_adjust_conjunct_order_by_cost()) {
241
679k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
242
343k
            return a->execute_cost() < b->execute_cost();
243
343k
        });
244
679k
    };
245
246
729k
    if (has_projection()) {
247
271k
        auto& projection = *_projection;
248
282k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
249
10.9k
            const auto& input_row_desc =
250
10.9k
                    i == 0 ? operator_row_desc_before_projection()
251
10.9k
                           : projection.intermediate_output_row_descriptors[i - 1];
252
10.9k
            RETURN_IF_ERROR(
253
10.9k
                    VExpr::prepare(projection.intermediate_projections[i], state, input_row_desc));
254
10.9k
        }
255
271k
        const auto& final_projection_input_row_desc =
256
271k
                projection.intermediate_output_row_descriptors.empty()
257
271k
                        ? operator_row_desc_before_projection()
258
271k
                        : projection.intermediate_output_row_descriptors.back();
259
271k
        RETURN_IF_ERROR(
260
271k
                VExpr::prepare(projection.projections, state, final_projection_input_row_desc));
261
271k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(projection.projections,
262
271k
                                                      projection.output_row_descriptor));
263
271k
    }
264
265
729k
    for (auto& conjunct : _conjuncts) {
266
278k
        RETURN_IF_ERROR(conjunct->open(state));
267
278k
    }
268
729k
    if (has_projection()) {
269
271k
        RETURN_IF_ERROR(VExpr::open(_projection->projections, state));
270
271k
        for (auto& projections : _projection->intermediate_projections) {
271
10.9k
            RETURN_IF_ERROR(VExpr::open(projections, state));
272
10.9k
        }
273
271k
    }
274
729k
    if (_child && !is_source()) {
275
106k
        RETURN_IF_ERROR(_child->prepare(state));
276
106k
    }
277
278
729k
    if (VExpr::contains_blockable_function(_conjuncts) ||
279
730k
        (has_projection() && VExpr::contains_blockable_function(_projection->projections))) {
280
0
        _blockable = true;
281
0
    }
282
283
729k
    return Status::OK();
284
729k
}
285
286
8.90k
Status OperatorXBase::terminate(RuntimeState* state) {
287
8.90k
    if (_child && !is_source()) {
288
719
        RETURN_IF_ERROR(_child->terminate(state));
289
719
    }
290
8.90k
    auto result = state->get_local_state_result(operator_id());
291
8.90k
    if (!result) {
292
0
        return result.error();
293
0
    }
294
8.90k
    return result.value()->terminate(state);
295
8.90k
}
296
297
4.54M
Status OperatorXBase::close(RuntimeState* state) {
298
4.54M
    if (_child && !is_source()) {
299
732k
        RETURN_IF_ERROR(_child->close(state));
300
732k
    }
301
4.54M
    auto result = state->get_local_state_result(operator_id());
302
4.54M
    if (!result) {
303
0
        return result.error();
304
0
    }
305
4.54M
    return result.value()->close(state);
306
4.54M
}
307
308
275k
void PipelineXLocalStateBase::clear_origin_block() {
309
275k
    _origin_block.clear_column_data(_parent->operator_row_desc_before_projection().num_slots());
310
275k
}
311
312
683k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
313
683k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
314
315
683k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
316
683k
    return Status::OK();
317
683k
}
318
319
0
bool PipelineXLocalStateBase::is_blockable() const {
320
0
    return std::any_of(_projections.begin(), _projections.end(),
321
0
                       [&](VExprContextSPtr expr) -> bool { return expr->is_blockable(); });
322
0
}
323
324
Status OperatorXBase::do_projections(RuntimeState* state, Block* origin_block,
325
275k
                                     Block* output_block) const {
326
275k
    auto* local_state = state->get_local_state(operator_id());
327
275k
    SCOPED_TIMER(local_state->exec_time_counter());
328
275k
    SCOPED_TIMER(local_state->_projection_timer);
329
275k
    const size_t rows = origin_block->rows();
330
275k
    if (rows == 0) {
331
142k
        return Status::OK();
332
142k
    }
333
132k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
334
335
132k
    {
336
132k
        Block input_block = *origin_block;
337
338
132k
        ColumnsWithTypeAndName new_columns;
339
132k
        for (const auto& projections : local_state->_intermediate_projections) {
340
3.69k
            if (projections.empty()) {
341
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
342
0
                                             node_id());
343
0
            }
344
3.69k
            new_columns.resize(projections.size());
345
54.3k
            for (int i = 0; i < projections.size(); i++) {
346
50.6k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
347
50.6k
                if (new_columns[i].column->size() != rows) {
348
0
                    return Status::InternalError(
349
0
                            "intermediate projection result column size {} not equal input rows "
350
0
                            "{}, expr: {}",
351
0
                            new_columns[i].column->size(), rows,
352
0
                            projections[i]->root()->debug_string());
353
0
                }
354
50.6k
            }
355
3.69k
            Block tmp_block {new_columns};
356
3.69k
            input_block.swap(tmp_block);
357
3.69k
        }
358
359
132k
        if (input_block.rows() != rows) {
360
0
            return Status::InternalError(
361
0
                    "after intermediate projections input block rows {} not equal origin rows {}, "
362
0
                    "input_block: {}",
363
0
                    input_block.rows(), rows, input_block.dump_structure());
364
0
        }
365
366
132k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
367
132k
                output_block, _projection->output_row_descriptor);
368
132k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
369
132k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
370
132k
        Columns shared_columns(mutable_columns.size());
371
372
763k
        for (int i = 0; i < mutable_columns.size(); ++i) {
373
631k
            ColumnPtr column_ptr;
374
631k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
375
631k
            if (column_ptr->size() != rows) {
376
0
                return Status::InternalError(
377
0
                        "projection result column size {} not equal input rows {}, expr: {}",
378
0
                        column_ptr->size(), rows,
379
0
                        local_state->_projections[i]->root()->debug_string());
380
0
            }
381
631k
            column_ptr = column_ptr->convert_to_full_column_if_const();
382
631k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
383
0
                column_ptr = make_nullable(column_ptr, false);
384
0
            }
385
631k
            if (column_ptr->is_exclusive()) {
386
229k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
387
401k
            } else {
388
401k
                shared_columns[i] = std::move(column_ptr);
389
401k
            }
390
631k
        }
391
392
132k
        scoped_mutable_block.restore();
393
763k
        for (int i = 0; i < shared_columns.size(); ++i) {
394
631k
            if (shared_columns[i]) {
395
401k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
396
401k
            }
397
631k
        }
398
132k
    }
399
400
0
    origin_block->clear_column_data(
401
132k
            local_state->_parent->operator_row_desc_before_projection().num_slots());
402
132k
    DCHECK_EQ(output_block->rows(), rows);
403
404
132k
    return Status::OK();
405
132k
}
406
407
3.96M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
408
3.96M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
409
3.96M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
410
3.96M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
411
3.96M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
412
3.96M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
413
3.96M
            if (_debug_point_count++ % 2 == 0) {
414
3.96M
                return Status::OK();
415
3.96M
            }
416
3.96M
        }
417
3.96M
    });
418
419
3.96M
    Status status;
420
3.96M
    auto* local_state = state->get_local_state(operator_id());
421
3.96M
    Defer defer([&]() {
422
3.96M
        if (status.ok()) {
423
3.96M
            local_state->update_output_block_counters(*block);
424
3.96M
        }
425
3.95M
    });
426
3.96M
    if (has_projection()) {
427
275k
        local_state->clear_origin_block();
428
275k
        status = get_block(state, &local_state->_origin_block, eos);
429
275k
        if (UNLIKELY(!status.ok())) {
430
25
            return status;
431
25
        }
432
275k
        status = do_projections(state, &local_state->_origin_block, block);
433
275k
        return status;
434
275k
    }
435
3.68M
    status = get_block(state, block, eos);
436
3.68M
    RETURN_IF_ERROR(block->check_type_and_column());
437
3.68M
    return status;
438
3.68M
}
439
440
2.65M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
441
2.65M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
442
9.71k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
443
9.71k
        *eos = true;
444
9.71k
    }
445
446
2.65M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
447
2.65M
        auto op_name = to_lower(_parent->_op_name);
448
2.65M
        auto arg_op_name = dp->param<std::string>("op_name");
449
2.65M
        arg_op_name = to_lower(arg_op_name);
450
451
2.65M
        if (op_name == arg_op_name) {
452
2.65M
            *eos = true;
453
2.65M
        }
454
2.65M
    });
455
456
2.65M
    if (auto rows = block->rows()) {
457
760k
        _num_rows_returned += rows;
458
760k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
459
760k
    }
460
2.65M
}
461
462
32.1k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
463
32.1k
    auto result = state->get_sink_local_state_result();
464
32.1k
    if (!result) {
465
0
        return result.error();
466
0
    }
467
32.1k
    return result.value()->terminate(state);
468
32.1k
}
469
470
16.6k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
471
16.6k
    fmt::memory_buffer debug_string_buffer;
472
473
16.6k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
474
16.6k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
475
16.6k
    return fmt::to_string(debug_string_buffer);
476
16.6k
}
477
478
16.6k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
479
16.6k
    return state->get_sink_local_state()->debug_string(indentation_level);
480
16.6k
}
481
482
363k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
483
363k
    std::string op_name = "UNKNOWN_SINK";
484
363k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
485
486
364k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
487
364k
        op_name = it->second;
488
364k
    }
489
363k
    _name = op_name + "_OPERATOR";
490
363k
    return Status::OK();
491
363k
}
492
493
306k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
494
306k
    std::string op_name = print_plan_node_type(tnode.node_type);
495
306k
    _nereids_id = tnode.nereids_id;
496
306k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
497
306k
    _name = substr + "_SINK_OPERATOR";
498
306k
    return Status::OK();
499
306k
}
500
501
template <typename LocalStateType>
502
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
503
1.63M
                                                            LocalSinkStateInfo& info) {
504
1.63M
    auto local_state = LocalStateType::create_unique(this, state);
505
1.63M
    RETURN_IF_ERROR(local_state->init(state, info));
506
1.63M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1.63M
    return Status::OK();
508
1.63M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
118k
                                                            LocalSinkStateInfo& info) {
504
118k
    auto local_state = LocalStateType::create_unique(this, state);
505
118k
    RETURN_IF_ERROR(local_state->init(state, info));
506
118k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
118k
    return Status::OK();
508
118k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
358k
                                                            LocalSinkStateInfo& info) {
504
358k
    auto local_state = LocalStateType::create_unique(this, state);
505
358k
    RETURN_IF_ERROR(local_state->init(state, info));
506
358k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
358k
    return Status::OK();
508
358k
}
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
3
                                                            LocalSinkStateInfo& info) {
504
3
    auto local_state = LocalStateType::create_unique(this, state);
505
3
    RETURN_IF_ERROR(local_state->init(state, info));
506
3
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
3
    return Status::OK();
508
3
}
_ZN5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
356
                                                            LocalSinkStateInfo& info) {
504
356
    auto local_state = LocalStateType::create_unique(this, state);
505
356
    RETURN_IF_ERROR(local_state->init(state, info));
506
356
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
356
    return Status::OK();
508
356
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
47.5k
                                                            LocalSinkStateInfo& info) {
504
47.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
47.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
47.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
47.5k
    return Status::OK();
508
47.5k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
48
                                                            LocalSinkStateInfo& info) {
504
48
    auto local_state = LocalStateType::create_unique(this, state);
505
48
    RETURN_IF_ERROR(local_state->init(state, info));
506
48
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
48
    return Status::OK();
508
48
}
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_25PaimonTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.06k
                                                            LocalSinkStateInfo& info) {
504
8.06k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.06k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.06k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.06k
    return Status::OK();
508
8.06k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
48
                                                            LocalSinkStateInfo& info) {
504
48
    auto local_state = LocalStateType::create_unique(this, state);
505
48
    RETURN_IF_ERROR(local_state->init(state, info));
506
48
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
48
    return Status::OK();
508
48
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
202k
                                                            LocalSinkStateInfo& info) {
504
202k
    auto local_state = LocalStateType::create_unique(this, state);
505
202k
    RETURN_IF_ERROR(local_state->init(state, info));
506
202k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
202k
    return Status::OK();
508
202k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
35
                                                            LocalSinkStateInfo& info) {
504
35
    auto local_state = LocalStateType::create_unique(this, state);
505
35
    RETURN_IF_ERROR(local_state->init(state, info));
506
35
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
35
    return Status::OK();
508
35
}
_ZN5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
230k
                                                            LocalSinkStateInfo& info) {
504
230k
    auto local_state = LocalStateType::create_unique(this, state);
505
230k
    RETURN_IF_ERROR(local_state->init(state, info));
506
230k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
230k
    return Status::OK();
508
230k
}
_ZN5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
96.5k
                                                            LocalSinkStateInfo& info) {
504
96.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
96.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
96.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
96.5k
    return Status::OK();
508
96.5k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
62.5k
                                                            LocalSinkStateInfo& info) {
504
62.5k
    auto local_state = LocalStateType::create_unique(this, state);
505
62.5k
    RETURN_IF_ERROR(local_state->init(state, info));
506
62.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
62.5k
    return Status::OK();
508
62.5k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
191
                                                            LocalSinkStateInfo& info) {
504
191
    auto local_state = LocalStateType::create_unique(this, state);
505
191
    RETURN_IF_ERROR(local_state->init(state, info));
506
191
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
191
    return Status::OK();
508
191
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
480k
                                                            LocalSinkStateInfo& info) {
504
480k
    auto local_state = LocalStateType::create_unique(this, state);
505
480k
    RETURN_IF_ERROR(local_state->init(state, info));
506
480k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
480k
    return Status::OK();
508
480k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
6.86k
                                                            LocalSinkStateInfo& info) {
504
6.86k
    auto local_state = LocalStateType::create_unique(this, state);
505
6.86k
    RETURN_IF_ERROR(local_state->init(state, info));
506
6.86k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
6.86k
    return Status::OK();
508
6.86k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
8.89k
                                                            LocalSinkStateInfo& info) {
504
8.89k
    auto local_state = LocalStateType::create_unique(this, state);
505
8.89k
    RETURN_IF_ERROR(local_state->init(state, info));
506
8.89k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
8.89k
    return Status::OK();
508
8.89k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.34k
                                                            LocalSinkStateInfo& info) {
504
2.34k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.34k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.34k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.34k
    return Status::OK();
508
2.34k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
454
                                                            LocalSinkStateInfo& info) {
504
454
    auto local_state = LocalStateType::create_unique(this, state);
505
454
    RETURN_IF_ERROR(local_state->init(state, info));
506
454
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
454
    return Status::OK();
508
454
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
4.88k
                                                            LocalSinkStateInfo& info) {
504
4.88k
    auto local_state = LocalStateType::create_unique(this, state);
505
4.88k
    RETURN_IF_ERROR(local_state->init(state, info));
506
4.88k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
4.88k
    return Status::OK();
508
4.88k
}
_ZN5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.77k
                                                            LocalSinkStateInfo& info) {
504
2.77k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.77k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.77k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.77k
    return Status::OK();
508
2.77k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.62k
                                                            LocalSinkStateInfo& info) {
504
2.62k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.62k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.62k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.62k
    return Status::OK();
508
2.62k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
2.57k
                                                            LocalSinkStateInfo& info) {
504
2.57k
    auto local_state = LocalStateType::create_unique(this, state);
505
2.57k
    RETURN_IF_ERROR(local_state->init(state, info));
506
2.57k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
2.57k
    return Status::OK();
508
2.57k
}
_ZN5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
1
                                                            LocalSinkStateInfo& info) {
504
1
    auto local_state = LocalStateType::create_unique(this, state);
505
1
    RETURN_IF_ERROR(local_state->init(state, info));
506
1
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
1
    return Status::OK();
508
1
}
_ZN5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
563
                                                            LocalSinkStateInfo& info) {
504
563
    auto local_state = LocalStateType::create_unique(this, state);
505
563
    RETURN_IF_ERROR(local_state->init(state, info));
506
563
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
563
    return Status::OK();
508
563
}
_ZN5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
14
                                                            LocalSinkStateInfo& info) {
504
14
    auto local_state = LocalStateType::create_unique(this, state);
505
14
    RETURN_IF_ERROR(local_state->init(state, info));
506
14
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
14
    return Status::OK();
508
14
}
_ZN5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
106
                                                            LocalSinkStateInfo& info) {
504
106
    auto local_state = LocalStateType::create_unique(this, state);
505
106
    RETURN_IF_ERROR(local_state->init(state, info));
506
106
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
106
    return Status::OK();
508
106
}
_ZN5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
_ZN5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
503
169
                                                            LocalSinkStateInfo& info) {
504
169
    auto local_state = LocalStateType::create_unique(this, state);
505
169
    RETURN_IF_ERROR(local_state->init(state, info));
506
169
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
507
169
    return Status::OK();
508
169
}
509
510
template <typename LocalStateType>
511
1.31M
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
0
                                 LocalExchangeSharedState>) {
514
0
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
0
                                        MultiCastSharedState>) {
517
0
        throw Exception(Status::FatalError("should not reach here!"));
518
1.31M
    } else {
519
1.31M
        auto ss = LocalStateType::SharedStateType::create_shared();
520
1.31M
        ss->id = operator_id();
521
1.31M
        for (auto& dest : dests_id()) {
522
1.31M
            ss->related_op_ids.insert(dest);
523
1.31M
        }
524
1.31M
        return ss;
525
1.31M
    }
526
1.31M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
103k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
103k
    } else {
519
103k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
103k
        ss->id = operator_id();
521
103k
        for (auto& dest : dests_id()) {
522
103k
            ss->related_op_ids.insert(dest);
523
103k
        }
524
103k
        return ss;
525
103k
    }
526
103k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
358k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
358k
    } else {
519
358k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
358k
        ss->id = operator_id();
521
358k
        for (auto& dest : dests_id()) {
522
358k
            ss->related_op_ids.insert(dest);
523
358k
        }
524
358k
        return ss;
525
358k
    }
526
358k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23JdbcTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27MemoryScratchSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
3
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
3
    } else {
519
3
        auto ss = LocalStateType::SharedStateType::create_shared();
520
3
        ss->id = operator_id();
521
3
        for (auto& dest : dests_id()) {
522
3
            ss->related_op_ids.insert(dest);
523
3
        }
524
3
        return ss;
525
3
    }
526
3
}
_ZNK5doris17DataSinkOperatorXINS_24ResultFileSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
356
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
356
    } else {
519
356
        auto ss = LocalStateType::SharedStateType::create_shared();
520
356
        ss->id = operator_id();
521
356
        for (auto& dest : dests_id()) {
522
355
            ss->related_op_ids.insert(dest);
523
355
        }
524
356
        return ss;
525
356
    }
526
356
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
47.6k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
47.6k
    } else {
519
47.6k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
47.6k
        ss->id = operator_id();
521
47.6k
        for (auto& dest : dests_id()) {
522
47.4k
            ss->related_op_ids.insert(dest);
523
47.4k
        }
524
47.6k
        return ss;
525
47.6k
    }
526
47.6k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
511
48
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
48
    } else {
519
48
        auto ss = LocalStateType::SharedStateType::create_shared();
520
48
        ss->id = operator_id();
521
48
        for (auto& dest : dests_id()) {
522
48
            ss->related_op_ids.insert(dest);
523
48
        }
524
48
        return ss;
525
48
    }
526
48
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_23HiveTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22TVFTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25PaimonTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_31SpillIcebergTableSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27IcebergDeleteSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26IcebergMergeSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_21MCTableSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_22AnalyticSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
8.08k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
8.08k
    } else {
519
8.08k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
8.08k
        ss->id = operator_id();
521
8.08k
        for (auto& dest : dests_id()) {
522
8.08k
            ss->related_op_ids.insert(dest);
523
8.08k
        }
524
8.08k
        return ss;
525
8.08k
    }
526
8.08k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
48
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
48
    } else {
519
48
        auto ss = LocalStateType::SharedStateType::create_shared();
520
48
        ss->id = operator_id();
521
48
        for (auto& dest : dests_id()) {
522
48
            ss->related_op_ids.insert(dest);
523
48
        }
524
48
        return ss;
525
48
    }
526
48
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
203k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
203k
    } else {
519
203k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
203k
        ss->id = operator_id();
521
203k
        for (auto& dest : dests_id()) {
522
203k
            ss->related_op_ids.insert(dest);
523
203k
        }
524
203k
        return ss;
525
203k
    }
526
203k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
37
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
37
    } else {
519
37
        auto ss = LocalStateType::SharedStateType::create_shared();
520
37
        ss->id = operator_id();
521
37
        for (auto& dest : dests_id()) {
522
37
            ss->related_op_ids.insert(dest);
523
37
        }
524
37
        return ss;
525
37
    }
526
37
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
96.8k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
96.8k
    } else {
519
96.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
96.8k
        ss->id = operator_id();
521
96.9k
        for (auto& dest : dests_id()) {
522
96.9k
            ss->related_op_ids.insert(dest);
523
96.9k
        }
524
96.8k
        return ss;
525
96.8k
    }
526
96.8k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
190
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
190
    } else {
519
190
        auto ss = LocalStateType::SharedStateType::create_shared();
520
190
        ss->id = operator_id();
521
190
        for (auto& dest : dests_id()) {
522
190
            ss->related_op_ids.insert(dest);
523
190
        }
524
190
        return ss;
525
190
    }
526
190
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
482k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
482k
    } else {
519
482k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
482k
        ss->id = operator_id();
521
482k
        for (auto& dest : dests_id()) {
522
479k
            ss->related_op_ids.insert(dest);
523
479k
        }
524
482k
        return ss;
525
482k
    }
526
482k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
6.86k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
6.86k
    } else {
519
6.86k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
6.86k
        ss->id = operator_id();
521
6.86k
        for (auto& dest : dests_id()) {
522
6.86k
            ss->related_op_ids.insert(dest);
523
6.86k
        }
524
6.86k
        return ss;
525
6.86k
    }
526
6.86k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
556
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
556
    } else {
519
556
        auto ss = LocalStateType::SharedStateType::create_shared();
520
556
        ss->id = operator_id();
521
556
        for (auto& dest : dests_id()) {
522
553
            ss->related_op_ids.insert(dest);
523
553
        }
524
556
        return ss;
525
556
    }
526
556
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
511
2.66k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.66k
    } else {
519
2.66k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.66k
        ss->id = operator_id();
521
2.66k
        for (auto& dest : dests_id()) {
522
2.66k
            ss->related_op_ids.insert(dest);
523
2.66k
        }
524
2.66k
        return ss;
525
2.66k
    }
526
2.66k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
511
2.59k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
2.59k
    } else {
519
2.59k
        auto ss = LocalStateType::SharedStateType::create_shared();
520
2.59k
        ss->id = operator_id();
521
2.60k
        for (auto& dest : dests_id()) {
522
2.60k
            ss->related_op_ids.insert(dest);
523
2.60k
        }
524
2.59k
        return ss;
525
2.59k
    }
526
2.59k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
563
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
563
    } else {
519
563
        auto ss = LocalStateType::SharedStateType::create_shared();
520
563
        ss->id = operator_id();
521
563
        for (auto& dest : dests_id()) {
522
560
            ss->related_op_ids.insert(dest);
523
560
        }
524
563
        return ss;
525
563
    }
526
563
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19CacheSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_18DictSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
511
106
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
512
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
513
                                 LocalExchangeSharedState>) {
514
        return nullptr;
515
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
516
                                        MultiCastSharedState>) {
517
        throw Exception(Status::FatalError("should not reach here!"));
518
106
    } else {
519
106
        auto ss = LocalStateType::SharedStateType::create_shared();
520
106
        ss->id = operator_id();
521
106
        for (auto& dest : dests_id()) {
522
106
            ss->related_op_ids.insert(dest);
523
106
        }
524
106
        return ss;
525
106
    }
526
106
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_20RecCTESinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_26RecCTEAnchorSinkLocalStateEE19create_shared_stateEv
527
528
template <typename LocalStateType>
529
1.93M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.93M
    auto local_state = LocalStateType::create_unique(state, this);
531
1.93M
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.93M
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.93M
    return Status::OK();
534
1.93M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
70.3k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
70.3k
    auto local_state = LocalStateType::create_unique(state, this);
531
70.3k
    RETURN_IF_ERROR(local_state->init(state, info));
532
70.3k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
70.3k
    return Status::OK();
534
70.3k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
248k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
248k
    auto local_state = LocalStateType::create_unique(state, this);
531
248k
    RETURN_IF_ERROR(local_state->init(state, info));
532
248k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
248k
    return Status::OK();
534
248k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
121
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
121
    auto local_state = LocalStateType::create_unique(state, this);
531
121
    RETURN_IF_ERROR(local_state->init(state, info));
532
121
    state->emplace_local_state(operator_id(), std::move(local_state));
533
121
    return Status::OK();
534
121
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_18JDBCScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_18FileScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
3.21k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
3.21k
    auto local_state = LocalStateType::create_unique(state, this);
531
3.21k
    RETURN_IF_ERROR(local_state->init(state, info));
532
3.21k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
3.21k
    return Status::OK();
534
3.21k
}
_ZN5doris9OperatorXINS_18AnalyticLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
8.04k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
8.04k
    auto local_state = LocalStateType::create_unique(state, this);
531
8.04k
    RETURN_IF_ERROR(local_state->init(state, info));
532
8.04k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
8.04k
    return Status::OK();
534
8.04k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.11k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.11k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.11k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.11k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.11k
    return Status::OK();
534
7.11k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
28
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
28
    auto local_state = LocalStateType::create_unique(state, this);
531
28
    RETURN_IF_ERROR(local_state->init(state, info));
532
28
    state->emplace_local_state(operator_id(), std::move(local_state));
533
28
    return Status::OK();
534
28
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
195k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
195k
    auto local_state = LocalStateType::create_unique(state, this);
531
195k
    RETURN_IF_ERROR(local_state->init(state, info));
532
195k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
195k
    return Status::OK();
534
195k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
96.5k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
96.5k
    auto local_state = LocalStateType::create_unique(state, this);
531
96.5k
    RETURN_IF_ERROR(local_state->init(state, info));
532
96.5k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
96.5k
    return Status::OK();
534
96.5k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
62.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
62.8k
    auto local_state = LocalStateType::create_unique(state, this);
531
62.8k
    RETURN_IF_ERROR(local_state->init(state, info));
532
62.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
62.8k
    return Status::OK();
534
62.8k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
181
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
181
    auto local_state = LocalStateType::create_unique(state, this);
531
181
    RETURN_IF_ERROR(local_state->init(state, info));
532
181
    state->emplace_local_state(operator_id(), std::move(local_state));
533
181
    return Status::OK();
534
181
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.37k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.37k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.37k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.37k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.37k
    return Status::OK();
534
6.37k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
272k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
272k
    auto local_state = LocalStateType::create_unique(state, this);
531
272k
    RETURN_IF_ERROR(local_state->init(state, info));
532
272k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
272k
    return Status::OK();
534
272k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.24k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.24k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.24k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.24k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.24k
    return Status::OK();
534
1.24k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
6.84k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
6.84k
    auto local_state = LocalStateType::create_unique(state, this);
531
6.84k
    RETURN_IF_ERROR(local_state->init(state, info));
532
6.84k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
6.84k
    return Status::OK();
534
6.84k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
27
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
27
    auto local_state = LocalStateType::create_unique(state, this);
531
27
    RETURN_IF_ERROR(local_state->init(state, info));
532
27
    state->emplace_local_state(operator_id(), std::move(local_state));
533
27
    return Status::OK();
534
27
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.54k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.54k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.54k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.54k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.54k
    return Status::OK();
534
1.54k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
55.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
55.1k
    auto local_state = LocalStateType::create_unique(state, this);
531
55.1k
    RETURN_IF_ERROR(local_state->init(state, info));
532
55.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
55.1k
    return Status::OK();
534
55.1k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
5.96k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
5.96k
    auto local_state = LocalStateType::create_unique(state, this);
531
5.96k
    RETURN_IF_ERROR(local_state->init(state, info));
532
5.96k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
5.96k
    return Status::OK();
534
5.96k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
454
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
454
    auto local_state = LocalStateType::create_unique(state, this);
531
454
    RETURN_IF_ERROR(local_state->init(state, info));
532
454
    state->emplace_local_state(operator_id(), std::move(local_state));
533
454
    return Status::OK();
534
454
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.62k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.62k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.62k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.62k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.62k
    return Status::OK();
534
2.62k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.57k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.57k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.57k
    return Status::OK();
534
2.57k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
464
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
464
    auto local_state = LocalStateType::create_unique(state, this);
531
464
    RETURN_IF_ERROR(local_state->init(state, info));
532
464
    state->emplace_local_state(operator_id(), std::move(local_state));
533
464
    return Status::OK();
534
464
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.69k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.69k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.69k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.69k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.69k
    return Status::OK();
534
1.69k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
10.5k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
10.5k
    auto local_state = LocalStateType::create_unique(state, this);
531
10.5k
    RETURN_IF_ERROR(local_state->init(state, info));
532
10.5k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
10.5k
    return Status::OK();
534
10.5k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
590k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
590k
    auto local_state = LocalStateType::create_unique(state, this);
531
590k
    RETURN_IF_ERROR(local_state->init(state, info));
532
590k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
590k
    return Status::OK();
534
590k
}
Unexecuted instantiation: _ZN5doris9OperatorXINS_34PartitionedHashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris9OperatorXINS_21CacheSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
14
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
14
    auto local_state = LocalStateType::create_unique(state, this);
531
14
    RETURN_IF_ERROR(local_state->init(state, info));
532
14
    state->emplace_local_state(operator_id(), std::move(local_state));
533
14
    return Status::OK();
534
14
}
_ZN5doris9OperatorXINS_22RecCTESourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
169
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
169
    auto local_state = LocalStateType::create_unique(state, this);
531
169
    RETURN_IF_ERROR(local_state->init(state, info));
532
169
    state->emplace_local_state(operator_id(), std::move(local_state));
533
169
    return Status::OK();
534
169
}
_ZN5doris9OperatorXINS_20RecCTEScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
2.20k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
2.20k
    auto local_state = LocalStateType::create_unique(state, this);
531
2.20k
    RETURN_IF_ERROR(local_state->init(state, info));
532
2.20k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
2.20k
    return Status::OK();
534
2.20k
}
_ZN5doris9OperatorXINS_25MaterializationLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
793
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
793
    auto local_state = LocalStateType::create_unique(state, this);
531
793
    RETURN_IF_ERROR(local_state->init(state, info));
532
793
    state->emplace_local_state(operator_id(), std::move(local_state));
533
793
    return Status::OK();
534
793
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
1.24k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
1.24k
    auto local_state = LocalStateType::create_unique(state, this);
531
1.24k
    RETURN_IF_ERROR(local_state->init(state, info));
532
1.24k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
1.24k
    return Status::OK();
534
1.24k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
7.06k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
7.06k
    auto local_state = LocalStateType::create_unique(state, this);
531
7.06k
    RETURN_IF_ERROR(local_state->init(state, info));
532
7.06k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
7.06k
    return Status::OK();
534
7.06k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
529
268k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
530
268k
    auto local_state = LocalStateType::create_unique(state, this);
531
268k
    RETURN_IF_ERROR(local_state->init(state, info));
532
268k
    state->emplace_local_state(operator_id(), std::move(local_state));
533
268k
    return Status::OK();
534
268k
}
535
536
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
537
                                                         RuntimeState* state)
538
1.63M
        : _parent(parent), _state(state) {}
539
540
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
541
1.92M
        : _num_rows_returned(0),
542
1.92M
          _rows_returned_counter(nullptr),
543
1.92M
          _parent(parent),
544
1.92M
          _state(state),
545
1.92M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
546
547
template <typename SharedStateArg>
548
1.93M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1.93M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1.93M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1.93M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1.93M
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1.93M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1.93M
    _operator_profile->add_child(_common_profile.get(), true);
557
1.93M
    _operator_profile->add_child(_custom_profile.get(), true);
558
1.93M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1.93M
    if constexpr (!is_fake_shared) {
560
1.10M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
666k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
666k
                                    .first.get()
563
666k
                                    ->template cast<SharedStateArg>();
564
565
666k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
666k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
666k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
666k
        } else if (info.shared_state) {
569
379k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
379k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
379k
            _dependency = _shared_state->create_source_dependency(
576
379k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
379k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
379k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
379k
        } else {
580
60.7k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
2.23k
                DCHECK(false);
582
2.23k
            }
583
60.7k
        }
584
1.10M
    }
585
586
1.93M
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1.93M
    _rows_returned_counter =
591
1.93M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1.93M
    _blocks_returned_counter =
593
1.93M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1.93M
    _output_block_bytes_counter =
595
1.93M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1.93M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1.93M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1.93M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1.93M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1.93M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1.93M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1.93M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1.93M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1.93M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1.93M
    _memory_used_counter =
606
1.93M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1.93M
    _common_profile->add_info_string("IsColocate",
608
1.93M
                                     std::to_string(_parent->is_colocated_operator()));
609
1.93M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1.93M
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1.93M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1.93M
    return Status::OK();
613
1.93M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
70.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
70.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
70.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
70.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
70.4k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
70.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
70.4k
    _operator_profile->add_child(_common_profile.get(), true);
557
70.4k
    _operator_profile->add_child(_custom_profile.get(), true);
558
70.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
70.4k
    if constexpr (!is_fake_shared) {
560
70.4k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
14.5k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
14.5k
                                    .first.get()
563
14.5k
                                    ->template cast<SharedStateArg>();
564
565
14.5k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
14.5k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
14.5k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
55.9k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
55.2k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
55.2k
            _dependency = _shared_state->create_source_dependency(
576
55.2k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
55.2k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
55.2k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
55.2k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
737
        }
584
70.4k
    }
585
586
70.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
70.4k
    _rows_returned_counter =
591
70.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
70.4k
    _blocks_returned_counter =
593
70.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
70.4k
    _output_block_bytes_counter =
595
70.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
70.4k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
70.4k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
70.4k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
70.4k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
70.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
70.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
70.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
70.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
70.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
70.4k
    _memory_used_counter =
606
70.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
70.4k
    _common_profile->add_info_string("IsColocate",
608
70.4k
                                     std::to_string(_parent->is_colocated_operator()));
609
70.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
70.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
70.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
70.4k
    return Status::OK();
613
70.4k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
1
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
1
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
1
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
1
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
1
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
1
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
1
    _operator_profile->add_child(_common_profile.get(), true);
557
1
    _operator_profile->add_child(_custom_profile.get(), true);
558
1
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
1
    if constexpr (!is_fake_shared) {
560
1
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
1
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
1
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
1
            _dependency = _shared_state->create_source_dependency(
576
1
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
1
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
1
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
1
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
1
    }
585
586
1
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
1
    _rows_returned_counter =
591
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
1
    _blocks_returned_counter =
593
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
1
    _output_block_bytes_counter =
595
1
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
1
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
1
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
1
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
1
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
1
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
1
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
1
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
1
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
1
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
1
    _memory_used_counter =
606
1
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
1
    _common_profile->add_info_string("IsColocate",
608
1
                                     std::to_string(_parent->is_colocated_operator()));
609
1
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
1
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
1
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
1
    return Status::OK();
613
1
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
203k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
203k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
203k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
203k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
203k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
203k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
203k
    _operator_profile->add_child(_common_profile.get(), true);
557
203k
    _operator_profile->add_child(_custom_profile.get(), true);
558
203k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
203k
    if constexpr (!is_fake_shared) {
560
203k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
203k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
197k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
197k
            _dependency = _shared_state->create_source_dependency(
576
197k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
197k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
197k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
197k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
5.37k
        }
584
203k
    }
585
586
203k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
203k
    _rows_returned_counter =
591
203k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
203k
    _blocks_returned_counter =
593
203k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
203k
    _output_block_bytes_counter =
595
203k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
203k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
203k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
203k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
203k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
203k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
203k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
203k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
203k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
203k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
203k
    _memory_used_counter =
606
203k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
203k
    _common_profile->add_info_string("IsColocate",
608
203k
                                     std::to_string(_parent->is_colocated_operator()));
609
203k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
203k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
203k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
203k
    return Status::OK();
613
203k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
28
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
28
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
28
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
28
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
28
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
28
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
28
    _operator_profile->add_child(_common_profile.get(), true);
557
28
    _operator_profile->add_child(_custom_profile.get(), true);
558
28
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
28
    if constexpr (!is_fake_shared) {
560
28
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
28
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
28
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
28
            _dependency = _shared_state->create_source_dependency(
576
28
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
28
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
28
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
28
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
28
    }
585
586
28
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
28
    _rows_returned_counter =
591
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
28
    _blocks_returned_counter =
593
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
28
    _output_block_bytes_counter =
595
28
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
28
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
28
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
28
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
28
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
28
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
28
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
28
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
28
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
28
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
28
    _memory_used_counter =
606
28
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
28
    _common_profile->add_info_string("IsColocate",
608
28
                                     std::to_string(_parent->is_colocated_operator()));
609
28
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
28
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
28
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
28
    return Status::OK();
613
28
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
6.86k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
6.86k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
6.86k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
6.86k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
6.86k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
6.86k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
6.86k
    _operator_profile->add_child(_common_profile.get(), true);
557
6.86k
    _operator_profile->add_child(_custom_profile.get(), true);
558
6.86k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
6.86k
    if constexpr (!is_fake_shared) {
560
6.86k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
6.86k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
6.80k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
6.80k
            _dependency = _shared_state->create_source_dependency(
576
6.80k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
6.80k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
6.80k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
6.80k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
61
        }
584
6.86k
    }
585
586
6.86k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
6.86k
    _rows_returned_counter =
591
6.86k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
6.86k
    _blocks_returned_counter =
593
6.86k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
6.86k
    _output_block_bytes_counter =
595
6.86k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
6.86k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
6.86k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
6.86k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
6.86k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
6.86k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
6.86k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
6.86k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
6.86k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
6.86k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
6.86k
    _memory_used_counter =
606
6.86k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
6.86k
    _common_profile->add_info_string("IsColocate",
608
6.86k
                                     std::to_string(_parent->is_colocated_operator()));
609
6.86k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
6.86k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
6.86k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
6.86k
    return Status::OK();
613
6.86k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
8.09k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
8.09k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
8.09k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
8.09k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
8.09k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
8.09k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
8.09k
    _operator_profile->add_child(_common_profile.get(), true);
557
8.09k
    _operator_profile->add_child(_custom_profile.get(), true);
558
8.09k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
8.09k
    if constexpr (!is_fake_shared) {
560
8.09k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
8.09k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
8.04k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
8.04k
            _dependency = _shared_state->create_source_dependency(
576
8.04k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
8.04k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
8.04k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
8.04k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
41
        }
584
8.09k
    }
585
586
8.09k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
8.09k
    _rows_returned_counter =
591
8.09k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
8.09k
    _blocks_returned_counter =
593
8.09k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
8.09k
    _output_block_bytes_counter =
595
8.09k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
8.09k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
8.09k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
8.09k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
8.09k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
8.09k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
8.09k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
8.09k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
8.09k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
8.09k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
8.09k
    _memory_used_counter =
606
8.09k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
8.09k
    _common_profile->add_info_string("IsColocate",
608
8.09k
                                     std::to_string(_parent->is_colocated_operator()));
609
8.09k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
8.09k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
8.09k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
8.09k
    return Status::OK();
613
8.09k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
96.8k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
96.8k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
96.8k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
96.8k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
96.8k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
96.8k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
96.8k
    _operator_profile->add_child(_common_profile.get(), true);
557
96.8k
    _operator_profile->add_child(_custom_profile.get(), true);
558
96.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
96.8k
    if constexpr (!is_fake_shared) {
560
96.8k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
96.8k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
95.9k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
95.9k
            _dependency = _shared_state->create_source_dependency(
576
95.9k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
95.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
95.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
95.9k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
902
        }
584
96.8k
    }
585
586
96.8k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
96.8k
    _rows_returned_counter =
591
96.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
96.8k
    _blocks_returned_counter =
593
96.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
96.8k
    _output_block_bytes_counter =
595
96.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
96.8k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
96.8k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
96.8k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
96.8k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
96.8k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
96.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
96.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
96.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
96.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
96.8k
    _memory_used_counter =
606
96.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
96.8k
    _common_profile->add_info_string("IsColocate",
608
96.8k
                                     std::to_string(_parent->is_colocated_operator()));
609
96.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
96.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
96.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
96.8k
    return Status::OK();
613
96.8k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
62.7k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
62.7k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
62.7k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
62.7k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
62.7k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
62.7k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
62.7k
    _operator_profile->add_child(_common_profile.get(), true);
557
62.7k
    _operator_profile->add_child(_custom_profile.get(), true);
558
62.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
62.7k
    if constexpr (!is_fake_shared) {
560
62.7k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
62.7k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
62.7k
                                    .first.get()
563
62.7k
                                    ->template cast<SharedStateArg>();
564
565
62.7k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
62.7k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
62.7k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
62.7k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
24
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
24
        }
584
62.7k
    }
585
586
62.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
62.7k
    _rows_returned_counter =
591
62.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
62.7k
    _blocks_returned_counter =
593
62.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
62.7k
    _output_block_bytes_counter =
595
62.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
62.7k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
62.7k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
62.7k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
62.7k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
62.7k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
62.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
62.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
62.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
62.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
62.7k
    _memory_used_counter =
606
62.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
62.7k
    _common_profile->add_info_string("IsColocate",
608
62.7k
                                     std::to_string(_parent->is_colocated_operator()));
609
62.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
62.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
62.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
62.7k
    return Status::OK();
613
62.7k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
180
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
180
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
180
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
180
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
180
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
180
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
180
    _operator_profile->add_child(_common_profile.get(), true);
557
180
    _operator_profile->add_child(_custom_profile.get(), true);
558
180
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
180
    if constexpr (!is_fake_shared) {
560
180
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
181
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
181
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
181
            _dependency = _shared_state->create_source_dependency(
576
181
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
181
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
181
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
18.4E
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
18.4E
        }
584
180
    }
585
586
180
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
180
    _rows_returned_counter =
591
180
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
180
    _blocks_returned_counter =
593
180
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
180
    _output_block_bytes_counter =
595
180
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
180
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
180
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
180
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
180
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
180
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
180
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
180
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
180
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
180
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
180
    _memory_used_counter =
606
180
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
180
    _common_profile->add_info_string("IsColocate",
608
180
                                     std::to_string(_parent->is_colocated_operator()));
609
180
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
180
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
180
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
180
    return Status::OK();
613
180
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
824k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
824k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
824k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
824k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
824k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
824k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
824k
    _operator_profile->add_child(_common_profile.get(), true);
557
824k
    _operator_profile->add_child(_custom_profile.get(), true);
558
824k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
    if constexpr (!is_fake_shared) {
560
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
                                    .first.get()
563
                                    ->template cast<SharedStateArg>();
564
565
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
            _dependency = _shared_state->create_source_dependency(
576
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
        }
584
    }
585
586
824k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
824k
    _rows_returned_counter =
591
824k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
824k
    _blocks_returned_counter =
593
824k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
824k
    _output_block_bytes_counter =
595
824k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
824k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
824k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
824k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
824k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
824k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
824k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
824k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
824k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
824k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
824k
    _memory_used_counter =
606
824k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
824k
    _common_profile->add_info_string("IsColocate",
608
824k
                                     std::to_string(_parent->is_colocated_operator()));
609
824k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
824k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
824k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
824k
    return Status::OK();
613
824k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
54.9k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
54.9k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
54.9k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
54.9k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
54.9k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
54.9k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
54.9k
    _operator_profile->add_child(_common_profile.get(), true);
557
54.9k
    _operator_profile->add_child(_custom_profile.get(), true);
558
54.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
54.9k
    if constexpr (!is_fake_shared) {
560
54.9k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
54.9k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
3.96k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
3.96k
            _dependency = _shared_state->create_source_dependency(
576
3.96k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
3.96k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
3.96k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
51.0k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
51.0k
        }
584
54.9k
    }
585
586
54.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
54.9k
    _rows_returned_counter =
591
54.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
54.9k
    _blocks_returned_counter =
593
54.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
54.9k
    _output_block_bytes_counter =
595
54.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
54.9k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
54.9k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
54.9k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
54.9k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
54.9k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
54.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
54.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
54.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
54.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
54.9k
    _memory_used_counter =
606
54.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
54.9k
    _common_profile->add_info_string("IsColocate",
608
54.9k
                                     std::to_string(_parent->is_colocated_operator()));
609
54.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
54.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
54.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
54.9k
    return Status::OK();
613
54.9k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
26
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
26
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
26
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
26
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
26
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
26
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
26
    _operator_profile->add_child(_common_profile.get(), true);
557
26
    _operator_profile->add_child(_custom_profile.get(), true);
558
26
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
26
    if constexpr (!is_fake_shared) {
560
26
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
26
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
26
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
26
            _dependency = _shared_state->create_source_dependency(
576
26
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
26
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
26
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
26
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
26
    }
585
586
26
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
26
    _rows_returned_counter =
591
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
26
    _blocks_returned_counter =
593
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
26
    _output_block_bytes_counter =
595
26
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
26
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
26
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
26
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
26
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
26
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
26
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
26
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
26
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
26
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
26
    _memory_used_counter =
606
26
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
26
    _common_profile->add_info_string("IsColocate",
608
26
                                     std::to_string(_parent->is_colocated_operator()));
609
26
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
26
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
26
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
26
    return Status::OK();
613
26
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.96k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.96k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.96k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.96k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.96k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.96k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.96k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.96k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.96k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.96k
    if constexpr (!is_fake_shared) {
560
5.96k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.96k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
5.94k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
5.94k
            _dependency = _shared_state->create_source_dependency(
576
5.94k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
5.94k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
5.94k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
5.94k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
19
        }
584
5.96k
    }
585
586
5.96k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.96k
    _rows_returned_counter =
591
5.96k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.96k
    _blocks_returned_counter =
593
5.96k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.96k
    _output_block_bytes_counter =
595
5.96k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.96k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.96k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.96k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.96k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.96k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.96k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.96k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.96k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.96k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.96k
    _memory_used_counter =
606
5.96k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.96k
    _common_profile->add_info_string("IsColocate",
608
5.96k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.96k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.96k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.96k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.96k
    return Status::OK();
613
5.96k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
554
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
554
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
554
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
554
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
554
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
554
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
554
    _operator_profile->add_child(_common_profile.get(), true);
557
554
    _operator_profile->add_child(_custom_profile.get(), true);
558
554
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
554
    if constexpr (!is_fake_shared) {
560
554
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
554
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
553
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
553
            _dependency = _shared_state->create_source_dependency(
576
553
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
553
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
553
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
553
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
1
        }
584
554
    }
585
586
556
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
554
    _rows_returned_counter =
591
554
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
554
    _blocks_returned_counter =
593
554
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
554
    _output_block_bytes_counter =
595
554
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
554
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
554
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
554
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
554
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
554
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
554
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
554
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
554
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
554
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
554
    _memory_used_counter =
606
554
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
554
    _common_profile->add_info_string("IsColocate",
608
554
                                     std::to_string(_parent->is_colocated_operator()));
609
554
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
554
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
554
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
554
    return Status::OK();
613
554
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
5.26k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
5.26k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
5.26k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
5.26k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
5.26k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
5.26k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
5.26k
    _operator_profile->add_child(_common_profile.get(), true);
557
5.26k
    _operator_profile->add_child(_custom_profile.get(), true);
558
5.26k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
5.26k
    if constexpr (!is_fake_shared) {
560
5.26k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
5.26k
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
4.96k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
4.96k
            _dependency = _shared_state->create_source_dependency(
576
4.96k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
4.96k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
4.96k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
4.96k
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
298
        }
584
5.26k
    }
585
586
5.26k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
5.26k
    _rows_returned_counter =
591
5.26k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
5.26k
    _blocks_returned_counter =
593
5.26k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
5.26k
    _output_block_bytes_counter =
595
5.26k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
5.26k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
5.26k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
5.26k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
5.26k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
5.26k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
5.26k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
5.26k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
5.26k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
5.26k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
5.26k
    _memory_used_counter =
606
5.26k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
5.26k
    _common_profile->add_info_string("IsColocate",
608
5.26k
                                     std::to_string(_parent->is_colocated_operator()));
609
5.26k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
5.26k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
5.26k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
5.26k
    return Status::OK();
613
5.26k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
591k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
591k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
591k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
591k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
591k
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
591k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
591k
    _operator_profile->add_child(_common_profile.get(), true);
557
591k
    _operator_profile->add_child(_custom_profile.get(), true);
558
591k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
591k
    if constexpr (!is_fake_shared) {
560
591k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
589k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
589k
                                    .first.get()
563
589k
                                    ->template cast<SharedStateArg>();
564
565
589k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
589k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
589k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
589k
        } else if (info.shared_state) {
569
0
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
0
                DCHECK(false);
571
0
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
0
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
0
            _dependency = _shared_state->create_source_dependency(
576
0
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
2.23k
        } else {
580
2.23k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
2.23k
                DCHECK(false);
582
2.23k
            }
583
2.23k
        }
584
591k
    }
585
586
591k
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
591k
    _rows_returned_counter =
591
591k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
591k
    _blocks_returned_counter =
593
591k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
591k
    _output_block_bytes_counter =
595
591k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
591k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
591k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
591k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
591k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
591k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
591k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
591k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
591k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
591k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
591k
    _memory_used_counter =
606
591k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
591k
    _common_profile->add_info_string("IsColocate",
608
591k
                                     std::to_string(_parent->is_colocated_operator()));
609
591k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
591k
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
591k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
591k
    return Status::OK();
613
591k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
548
169
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
549
169
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
550
169
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
551
169
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
552
169
    _operator_profile->set_metadata(_parent->node_id());
553
    // indent is false so that source operator will have same
554
    // indentation_level with its parent operator.
555
169
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
556
169
    _operator_profile->add_child(_common_profile.get(), true);
557
169
    _operator_profile->add_child(_custom_profile.get(), true);
558
169
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
559
169
    if constexpr (!is_fake_shared) {
560
169
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
561
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
562
0
                                    .first.get()
563
0
                                    ->template cast<SharedStateArg>();
564
565
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
566
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
567
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
568
169
        } else if (info.shared_state) {
569
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
570
                DCHECK(false);
571
            }
572
            // For UnionSourceOperator without children, there is no shared state.
573
169
            _shared_state = info.shared_state->template cast<SharedStateArg>();
574
575
169
            _dependency = _shared_state->create_source_dependency(
576
169
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
577
169
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
578
169
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
579
169
        } else {
580
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
581
                DCHECK(false);
582
            }
583
0
        }
584
169
    }
585
586
169
    if (must_set_shared_state() && _shared_state == nullptr) {
587
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
588
0
    }
589
590
169
    _rows_returned_counter =
591
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
592
169
    _blocks_returned_counter =
593
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
594
169
    _output_block_bytes_counter =
595
169
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
596
169
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
597
169
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
598
169
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
599
169
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
600
169
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
601
169
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
602
169
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
603
169
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
604
169
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
605
169
    _memory_used_counter =
606
169
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
607
169
    _common_profile->add_info_string("IsColocate",
608
169
                                     std::to_string(_parent->is_colocated_operator()));
609
169
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
610
169
    _common_profile->add_info_string("FollowedByShuffledOperator",
611
169
                                     std::to_string(_parent->followed_by_shuffled_operator()));
612
169
    return Status::OK();
613
169
}
614
615
template <typename SharedStateArg>
616
1.94M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
1.94M
    _conjuncts.resize(_parent->_conjuncts.size());
618
2.24M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
308k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
308k
    }
621
1.94M
    if (_parent->has_projection()) {
622
391k
        const auto& projection = *_parent->_projection;
623
391k
        _projections.resize(projection.projections.size());
624
2.43M
        for (size_t i = 0; i < _projections.size(); i++) {
625
2.04M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
2.04M
        }
627
391k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
412k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
21.2k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
202k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
181k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
181k
                        state, _intermediate_projections[i][j]));
633
181k
            }
634
21.2k
        }
635
391k
    }
636
1.94M
    return Status::OK();
637
1.94M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
70.6k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
70.6k
    _conjuncts.resize(_parent->_conjuncts.size());
618
72.0k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.37k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.37k
    }
621
70.6k
    if (_parent->has_projection()) {
622
70.6k
        const auto& projection = *_parent->_projection;
623
70.6k
        _projections.resize(projection.projections.size());
624
380k
        for (size_t i = 0; i < _projections.size(); i++) {
625
309k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
309k
        }
627
70.6k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
75.5k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
4.92k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
106k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
101k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
101k
                        state, _intermediate_projections[i][j]));
633
101k
            }
634
4.92k
        }
635
70.6k
    }
636
70.6k
    return Status::OK();
637
70.6k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
3
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
3
    _conjuncts.resize(_parent->_conjuncts.size());
618
3
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
3
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
3
    return Status::OK();
637
3
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
203k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
203k
    _conjuncts.resize(_parent->_conjuncts.size());
618
203k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
203k
    if (_parent->has_projection()) {
622
80
        const auto& projection = *_parent->_projection;
623
80
        _projections.resize(projection.projections.size());
624
402
        for (size_t i = 0; i < _projections.size(); i++) {
625
322
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
322
        }
627
80
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
80
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
80
    }
636
203k
    return Status::OK();
637
203k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
28
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
28
    _conjuncts.resize(_parent->_conjuncts.size());
618
28
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
28
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
28
    return Status::OK();
637
28
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
6.87k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
6.87k
    _conjuncts.resize(_parent->_conjuncts.size());
618
6.94k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
74
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
74
    }
621
6.87k
    if (_parent->has_projection()) {
622
6.87k
        const auto& projection = *_parent->_projection;
623
6.87k
        _projections.resize(projection.projections.size());
624
31.3k
        for (size_t i = 0; i < _projections.size(); i++) {
625
24.4k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
24.4k
        }
627
6.87k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
6.90k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
28
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
230
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
202
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
202
                        state, _intermediate_projections[i][j]));
633
202
            }
634
28
        }
635
6.87k
    }
636
6.87k
    return Status::OK();
637
6.87k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
8.09k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
8.09k
    _conjuncts.resize(_parent->_conjuncts.size());
618
9.05k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
957
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
957
    }
621
8.09k
    if (_parent->has_projection()) {
622
3.91k
        const auto& projection = *_parent->_projection;
623
3.91k
        _projections.resize(projection.projections.size());
624
16.8k
        for (size_t i = 0; i < _projections.size(); i++) {
625
12.8k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
12.8k
        }
627
3.91k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
4.00k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
85
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
636
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
551
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
551
                        state, _intermediate_projections[i][j]));
633
551
            }
634
85
        }
635
3.91k
    }
636
8.09k
    return Status::OK();
637
8.09k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
96.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
96.8k
    _conjuncts.resize(_parent->_conjuncts.size());
618
98.3k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.47k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.47k
    }
621
96.8k
    if (_parent->has_projection()) {
622
31.0k
        const auto& projection = *_parent->_projection;
623
31.0k
        _projections.resize(projection.projections.size());
624
283k
        for (size_t i = 0; i < _projections.size(); i++) {
625
252k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
252k
        }
627
31.0k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
31.8k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
764
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
5.10k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
4.34k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
4.34k
                        state, _intermediate_projections[i][j]));
633
4.34k
            }
634
764
        }
635
31.0k
    }
636
96.8k
    return Status::OK();
637
96.8k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
62.8k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
62.8k
    _conjuncts.resize(_parent->_conjuncts.size());
618
62.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
24
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
24
    }
621
62.8k
    if (_parent->has_projection()) {
622
185
        const auto& projection = *_parent->_projection;
623
185
        _projections.resize(projection.projections.size());
624
666
        for (size_t i = 0; i < _projections.size(); i++) {
625
481
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
481
        }
627
185
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
185
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
185
    }
636
62.8k
    return Status::OK();
637
62.8k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
185
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
185
    _conjuncts.resize(_parent->_conjuncts.size());
618
185
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
185
    if (_parent->has_projection()) {
622
164
        const auto& projection = *_parent->_projection;
623
164
        _projections.resize(projection.projections.size());
624
492
        for (size_t i = 0; i < _projections.size(); i++) {
625
328
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
328
        }
627
164
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
164
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
164
    }
636
185
    return Status::OK();
637
185
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
828k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
828k
    _conjuncts.resize(_parent->_conjuncts.size());
618
1.13M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
303k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
303k
    }
621
828k
    if (_parent->has_projection()) {
622
266k
        const auto& projection = *_parent->_projection;
623
266k
        _projections.resize(projection.projections.size());
624
1.60M
        for (size_t i = 0; i < _projections.size(); i++) {
625
1.34M
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
1.34M
        }
627
266k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
282k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
15.3k
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
88.2k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
72.9k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
72.9k
                        state, _intermediate_projections[i][j]));
633
72.9k
            }
634
15.3k
        }
635
266k
    }
636
828k
    return Status::OK();
637
828k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
55.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
55.3k
    _conjuncts.resize(_parent->_conjuncts.size());
618
55.3k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
55.3k
    if (_parent->has_projection()) {
622
11.4k
        const auto& projection = *_parent->_projection;
623
11.4k
        _projections.resize(projection.projections.size());
624
111k
        for (size_t i = 0; i < _projections.size(); i++) {
625
99.6k
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
99.6k
        }
627
11.4k
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
11.5k
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
128
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
2.15k
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
2.02k
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
2.02k
                        state, _intermediate_projections[i][j]));
633
2.02k
            }
634
128
        }
635
11.4k
    }
636
55.3k
    return Status::OK();
637
55.3k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
25
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
25
    _conjuncts.resize(_parent->_conjuncts.size());
618
25
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
25
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
25
    return Status::OK();
637
25
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.95k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.95k
    _conjuncts.resize(_parent->_conjuncts.size());
618
7.18k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
1.23k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
1.23k
    }
621
5.95k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
5.95k
    return Status::OK();
637
5.95k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
556
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
556
    _conjuncts.resize(_parent->_conjuncts.size());
618
556
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
556
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
556
    return Status::OK();
637
556
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
5.31k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
5.31k
    _conjuncts.resize(_parent->_conjuncts.size());
618
5.31k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
5.31k
    if (_parent->has_projection()) {
622
60
        const auto& projection = *_parent->_projection;
623
60
        _projections.resize(projection.projections.size());
624
228
        for (size_t i = 0; i < _projections.size(); i++) {
625
168
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
168
        }
627
60
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
60
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
60
    }
636
5.31k
    return Status::OK();
637
5.31k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
594k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
594k
    _conjuncts.resize(_parent->_conjuncts.size());
618
594k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
0
    }
621
594k
    if (_parent->has_projection()) {
622
0
        const auto& projection = *_parent->_projection;
623
0
        _projections.resize(projection.projections.size());
624
0
        for (size_t i = 0; i < _projections.size(); i++) {
625
0
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
0
        }
627
0
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
0
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
0
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
0
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
0
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
0
                        state, _intermediate_projections[i][j]));
633
0
            }
634
0
        }
635
0
    }
636
594k
    return Status::OK();
637
594k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE4openEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
616
169
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
617
169
    _conjuncts.resize(_parent->_conjuncts.size());
618
176
    for (size_t i = 0; i < _conjuncts.size(); i++) {
619
7
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
620
7
    }
621
169
    if (_parent->has_projection()) {
622
166
        const auto& projection = *_parent->_projection;
623
166
        _projections.resize(projection.projections.size());
624
491
        for (size_t i = 0; i < _projections.size(); i++) {
625
325
            RETURN_IF_ERROR(projection.projections[i]->clone(state, _projections[i]));
626
325
        }
627
166
        _intermediate_projections.resize(projection.intermediate_projections.size());
628
169
        for (int i = 0; i < projection.intermediate_projections.size(); i++) {
629
3
            _intermediate_projections[i].resize(projection.intermediate_projections[i].size());
630
11
            for (int j = 0; j < projection.intermediate_projections[i].size(); j++) {
631
8
                RETURN_IF_ERROR(projection.intermediate_projections[i][j]->clone(
632
8
                        state, _intermediate_projections[i][j]));
633
8
            }
634
3
        }
635
166
    }
636
169
    return Status::OK();
637
169
}
638
639
template <typename SharedStateArg>
640
8.90k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
8.90k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
8.90k
    _terminated = true;
645
8.90k
    return Status::OK();
646
8.90k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
363
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
363
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
363
    _terminated = true;
645
363
    return Status::OK();
646
363
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
36
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
36
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
36
    _terminated = true;
645
36
    return Status::OK();
646
36
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
35
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
35
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
35
    _terminated = true;
645
35
    return Status::OK();
646
35
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
50
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
50
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
50
    _terminated = true;
645
50
    return Status::OK();
646
50
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
6.99k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
6.99k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
6.99k
    _terminated = true;
645
6.99k
    return Status::OK();
646
6.99k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
22
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
22
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
22
    _terminated = true;
645
22
    return Status::OK();
646
22
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
10
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
10
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
10
    _terminated = true;
645
10
    return Status::OK();
646
10
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
162
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
162
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
162
    _terminated = true;
645
162
    return Status::OK();
646
162
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
1.18k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
1.18k
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
1.18k
    _terminated = true;
645
1.18k
    return Status::OK();
646
1.18k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
640
38
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
641
38
    if (_terminated) {
642
0
        return Status::OK();
643
0
    }
644
38
    _terminated = true;
645
38
    return Status::OK();
646
38
}
647
648
template <typename SharedStateArg>
649
2.17M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
2.17M
    if (_closed) {
651
233k
        return Status::OK();
652
233k
    }
653
1.93M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
1.10M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
1.10M
    }
656
1.93M
    _closed = true;
657
1.93M
    return Status::OK();
658
2.17M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
70.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
70.5k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
70.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
70.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
70.5k
    }
656
70.5k
    _closed = true;
657
70.5k
    return Status::OK();
658
70.5k
}
_ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
4
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
4
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
4
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
4
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
4
    }
656
4
    _closed = true;
657
4
    return Status::OK();
658
4
}
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
404k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
404k
    if (_closed) {
651
202k
        return Status::OK();
652
202k
    }
653
201k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
201k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
201k
    }
656
201k
    _closed = true;
657
201k
    return Status::OK();
658
404k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
28
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
28
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
28
    }
656
28
    _closed = true;
657
28
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
6.86k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
6.86k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
6.86k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
6.86k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
6.86k
    }
656
6.86k
    _closed = true;
657
6.86k
    return Status::OK();
658
6.86k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
16.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
16.3k
    if (_closed) {
651
8.24k
        return Status::OK();
652
8.24k
    }
653
8.07k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
8.07k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
8.07k
    }
656
8.07k
    _closed = true;
657
8.07k
    return Status::OK();
658
16.3k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
96.6k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
96.6k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
96.6k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
96.6k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
96.6k
    }
656
96.6k
    _closed = true;
657
96.6k
    return Status::OK();
658
96.6k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
62.4k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
62.4k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
62.4k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
62.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
62.4k
    }
656
62.4k
    _closed = true;
657
62.4k
    return Status::OK();
658
62.4k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
180
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
180
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
180
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
180
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
180
    }
656
180
    _closed = true;
657
180
    return Status::OK();
658
180
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
846k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
846k
    if (_closed) {
651
16.8k
        return Status::OK();
652
16.8k
    }
653
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
    }
656
829k
    _closed = true;
657
829k
    return Status::OK();
658
846k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
55.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
55.3k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
55.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
55.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
55.3k
    }
656
55.3k
    _closed = true;
657
55.3k
    return Status::OK();
658
55.3k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
28
    if (_closed) {
651
14
        return Status::OK();
652
14
    }
653
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
14
    }
656
14
    _closed = true;
657
14
    return Status::OK();
658
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
5.93k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
5.93k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
5.93k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.93k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.93k
    }
656
5.93k
    _closed = true;
657
5.93k
    return Status::OK();
658
5.93k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
905
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
905
    if (_closed) {
651
454
        return Status::OK();
652
454
    }
653
451
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
451
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
451
    }
656
451
    _closed = true;
657
451
    return Status::OK();
658
905
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
10.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
10.7k
    if (_closed) {
651
5.40k
        return Status::OK();
652
5.40k
    }
653
5.30k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
5.30k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
5.30k
    }
656
5.30k
    _closed = true;
657
5.30k
    return Status::OK();
658
10.7k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
596k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
596k
    if (_closed) {
651
0
        return Status::OK();
652
0
    }
653
596k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
596k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
596k
    }
656
596k
    _closed = true;
657
596k
    return Status::OK();
658
596k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
649
333
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
650
333
    if (_closed) {
651
173
        return Status::OK();
652
173
    }
653
160
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
654
160
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
655
160
    }
656
160
    _closed = true;
657
160
    return Status::OK();
658
333
}
659
660
template <typename SharedState>
661
1.64M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
1.64M
    _operator_profile =
664
1.64M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
1.64M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
1.64M
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
1.64M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
1.64M
    _operator_profile->add_child(_common_profile, true);
673
1.64M
    _operator_profile->add_child(_custom_profile, true);
674
675
1.64M
    _operator_profile->set_metadata(_parent->node_id());
676
1.64M
    _wait_for_finish_dependency_timer =
677
1.64M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
1.64M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
1.64M
    if constexpr (!is_fake_shared) {
680
1.15M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
1.15M
            info.shared_state_map.end()) {
682
308k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
230k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
230k
            }
685
308k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
308k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
308k
                                                  ? 0
688
308k
                                                  : info.task_idx]
689
308k
                                  .get();
690
308k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
851k
        } else {
692
851k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
27
                DCHECK(false);
694
27
            }
695
851k
            _shared_state = info.shared_state->template cast<SharedState>();
696
851k
            _dependency = _shared_state->create_sink_dependency(
697
851k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
851k
        }
699
1.15M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
1.15M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
1.15M
    }
702
703
1.64M
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
1.64M
    _rows_input_counter =
708
1.64M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
1.64M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
1.64M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
1.64M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
1.64M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
1.64M
    _memory_used_counter =
714
1.64M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
1.64M
    _common_profile->add_info_string("IsColocate",
716
1.64M
                                     std::to_string(_parent->is_colocated_operator()));
717
1.64M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
1.64M
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
1.64M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
1.64M
    return Status::OK();
721
1.64M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
118k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
118k
    _operator_profile =
664
118k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
118k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
118k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
118k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
118k
    _operator_profile->add_child(_common_profile, true);
673
118k
    _operator_profile->add_child(_custom_profile, true);
674
675
118k
    _operator_profile->set_metadata(_parent->node_id());
676
118k
    _wait_for_finish_dependency_timer =
677
118k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
118k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
118k
    if constexpr (!is_fake_shared) {
680
118k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
118k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
14.7k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
14.7k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
14.7k
                                                  ? 0
688
14.7k
                                                  : info.task_idx]
689
14.7k
                                  .get();
690
14.7k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
103k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
103k
            _shared_state = info.shared_state->template cast<SharedState>();
696
103k
            _dependency = _shared_state->create_sink_dependency(
697
103k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
103k
        }
699
118k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
118k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
118k
    }
702
703
118k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
118k
    _rows_input_counter =
708
118k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
118k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
118k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
118k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
118k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
118k
    _memory_used_counter =
714
118k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
118k
    _common_profile->add_info_string("IsColocate",
716
118k
                                     std::to_string(_parent->is_colocated_operator()));
717
118k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
118k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
118k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
118k
    return Status::OK();
721
118k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2
    _operator_profile =
664
2
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2
    _operator_profile->add_child(_common_profile, true);
673
2
    _operator_profile->add_child(_custom_profile, true);
674
675
2
    _operator_profile->set_metadata(_parent->node_id());
676
2
    _wait_for_finish_dependency_timer =
677
2
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2
    if constexpr (!is_fake_shared) {
680
2
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2
            _shared_state = info.shared_state->template cast<SharedState>();
696
2
            _dependency = _shared_state->create_sink_dependency(
697
2
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2
        }
699
2
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2
    }
702
703
2
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2
    _rows_input_counter =
708
2
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2
    _memory_used_counter =
714
2
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2
    _common_profile->add_info_string("IsColocate",
716
2
                                     std::to_string(_parent->is_colocated_operator()));
717
2
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2
    return Status::OK();
721
2
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
203k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
203k
    _operator_profile =
664
203k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
203k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
203k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
203k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
203k
    _operator_profile->add_child(_common_profile, true);
673
203k
    _operator_profile->add_child(_custom_profile, true);
674
675
203k
    _operator_profile->set_metadata(_parent->node_id());
676
203k
    _wait_for_finish_dependency_timer =
677
203k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
203k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
203k
    if constexpr (!is_fake_shared) {
680
203k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
203k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
203k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
203k
            _shared_state = info.shared_state->template cast<SharedState>();
696
203k
            _dependency = _shared_state->create_sink_dependency(
697
203k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
203k
        }
699
203k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
203k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
203k
    }
702
703
203k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
203k
    _rows_input_counter =
708
203k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
203k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
203k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
203k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
203k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
203k
    _memory_used_counter =
714
203k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
203k
    _common_profile->add_info_string("IsColocate",
716
203k
                                     std::to_string(_parent->is_colocated_operator()));
717
203k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
203k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
203k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
203k
    return Status::OK();
721
203k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
35
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
35
    _operator_profile =
664
35
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
35
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
35
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
35
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
35
    _operator_profile->add_child(_common_profile, true);
673
35
    _operator_profile->add_child(_custom_profile, true);
674
675
35
    _operator_profile->set_metadata(_parent->node_id());
676
35
    _wait_for_finish_dependency_timer =
677
35
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
35
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
35
    if constexpr (!is_fake_shared) {
680
35
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
35
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
35
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
35
            _shared_state = info.shared_state->template cast<SharedState>();
696
35
            _dependency = _shared_state->create_sink_dependency(
697
35
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
35
        }
699
35
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
35
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
35
    }
702
703
35
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
35
    _rows_input_counter =
708
35
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
35
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
35
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
35
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
35
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
35
    _memory_used_counter =
714
35
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
35
    _common_profile->add_info_string("IsColocate",
716
35
                                     std::to_string(_parent->is_colocated_operator()));
717
35
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
35
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
35
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
35
    return Status::OK();
721
35
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
6.86k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
6.86k
    _operator_profile =
664
6.86k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
6.86k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
6.86k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
6.86k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
6.86k
    _operator_profile->add_child(_common_profile, true);
673
6.86k
    _operator_profile->add_child(_custom_profile, true);
674
675
6.86k
    _operator_profile->set_metadata(_parent->node_id());
676
6.86k
    _wait_for_finish_dependency_timer =
677
6.86k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
6.86k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
6.86k
    if constexpr (!is_fake_shared) {
680
6.86k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
6.86k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
6.86k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
6.86k
            _shared_state = info.shared_state->template cast<SharedState>();
696
6.86k
            _dependency = _shared_state->create_sink_dependency(
697
6.86k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
6.86k
        }
699
6.86k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
6.86k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
6.86k
    }
702
703
6.86k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
6.86k
    _rows_input_counter =
708
6.86k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
6.86k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
6.86k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
6.86k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
6.86k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
6.86k
    _memory_used_counter =
714
6.86k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
6.86k
    _common_profile->add_info_string("IsColocate",
716
6.86k
                                     std::to_string(_parent->is_colocated_operator()));
717
6.86k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
6.86k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
6.86k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
6.86k
    return Status::OK();
721
6.86k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.08k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.08k
    _operator_profile =
664
8.08k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.08k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.08k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.08k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.08k
    _operator_profile->add_child(_common_profile, true);
673
8.08k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.08k
    _operator_profile->set_metadata(_parent->node_id());
676
8.08k
    _wait_for_finish_dependency_timer =
677
8.08k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.08k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.08k
    if constexpr (!is_fake_shared) {
680
8.08k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.08k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.08k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.08k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.08k
            _dependency = _shared_state->create_sink_dependency(
697
8.08k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.08k
        }
699
8.08k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.08k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.08k
    }
702
703
8.08k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.08k
    _rows_input_counter =
708
8.08k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.08k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.08k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.08k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.08k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.08k
    _memory_used_counter =
714
8.08k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.08k
    _common_profile->add_info_string("IsColocate",
716
8.08k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.08k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.08k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.08k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.08k
    return Status::OK();
721
8.08k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
96.8k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
96.8k
    _operator_profile =
664
96.8k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
96.8k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
96.8k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
96.8k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
96.8k
    _operator_profile->add_child(_common_profile, true);
673
96.8k
    _operator_profile->add_child(_custom_profile, true);
674
675
96.8k
    _operator_profile->set_metadata(_parent->node_id());
676
96.8k
    _wait_for_finish_dependency_timer =
677
96.8k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
96.8k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
96.8k
    if constexpr (!is_fake_shared) {
680
96.8k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
96.8k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
96.8k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
96.8k
            _shared_state = info.shared_state->template cast<SharedState>();
696
96.8k
            _dependency = _shared_state->create_sink_dependency(
697
96.8k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
96.8k
        }
699
96.8k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
96.8k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
96.8k
    }
702
703
96.8k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
96.8k
    _rows_input_counter =
708
96.8k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
96.8k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
96.8k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
96.8k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
96.8k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
96.8k
    _memory_used_counter =
714
96.8k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
96.8k
    _common_profile->add_info_string("IsColocate",
716
96.8k
                                     std::to_string(_parent->is_colocated_operator()));
717
96.8k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
96.8k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
96.8k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
96.8k
    return Status::OK();
721
96.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
62.7k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
62.7k
    _operator_profile =
664
62.7k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
62.7k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
62.7k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
62.7k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
62.7k
    _operator_profile->add_child(_common_profile, true);
673
62.7k
    _operator_profile->add_child(_custom_profile, true);
674
675
62.7k
    _operator_profile->set_metadata(_parent->node_id());
676
62.7k
    _wait_for_finish_dependency_timer =
677
62.7k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
62.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
62.7k
    if constexpr (!is_fake_shared) {
680
62.7k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
62.7k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
62.7k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
62.7k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
62.7k
                                                  ? 0
688
62.7k
                                                  : info.task_idx]
689
62.7k
                                  .get();
690
62.7k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
18.4E
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
696
18.4E
            _dependency = _shared_state->create_sink_dependency(
697
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
18.4E
        }
699
62.7k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
62.7k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
62.7k
    }
702
703
62.7k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
62.7k
    _rows_input_counter =
708
62.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
62.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
62.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
62.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
62.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
62.7k
    _memory_used_counter =
714
62.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
62.7k
    _common_profile->add_info_string("IsColocate",
716
62.7k
                                     std::to_string(_parent->is_colocated_operator()));
717
62.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
62.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
62.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
62.7k
    return Status::OK();
721
62.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
191
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
191
    _operator_profile =
664
191
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
191
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
191
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
191
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
191
    _operator_profile->add_child(_common_profile, true);
673
191
    _operator_profile->add_child(_custom_profile, true);
674
675
191
    _operator_profile->set_metadata(_parent->node_id());
676
191
    _wait_for_finish_dependency_timer =
677
191
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
191
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
191
    if constexpr (!is_fake_shared) {
680
191
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
191
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
191
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
191
            _shared_state = info.shared_state->template cast<SharedState>();
696
191
            _dependency = _shared_state->create_sink_dependency(
697
191
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
191
        }
699
191
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
191
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
191
    }
702
703
191
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
191
    _rows_input_counter =
708
191
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
191
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
191
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
191
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
191
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
191
    _memory_used_counter =
714
191
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
191
    _common_profile->add_info_string("IsColocate",
716
191
                                     std::to_string(_parent->is_colocated_operator()));
717
191
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
191
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
191
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
191
    return Status::OK();
721
191
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
481k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
481k
    _operator_profile =
664
481k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
481k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
481k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
481k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
481k
    _operator_profile->add_child(_common_profile, true);
673
481k
    _operator_profile->add_child(_custom_profile, true);
674
675
481k
    _operator_profile->set_metadata(_parent->node_id());
676
481k
    _wait_for_finish_dependency_timer =
677
481k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
481k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
    if constexpr (!is_fake_shared) {
680
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
                                                  ? 0
688
                                                  : info.task_idx]
689
                                  .get();
690
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
            _shared_state = info.shared_state->template cast<SharedState>();
696
            _dependency = _shared_state->create_sink_dependency(
697
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
        }
699
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
    }
702
703
481k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
481k
    _rows_input_counter =
708
481k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
481k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
481k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
481k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
481k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
481k
    _memory_used_counter =
714
481k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
481k
    _common_profile->add_info_string("IsColocate",
716
481k
                                     std::to_string(_parent->is_colocated_operator()));
717
481k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
481k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
481k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
481k
    return Status::OK();
721
481k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
8.92k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
8.92k
    _operator_profile =
664
8.92k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
8.92k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
8.92k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
8.92k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
8.92k
    _operator_profile->add_child(_common_profile, true);
673
8.92k
    _operator_profile->add_child(_custom_profile, true);
674
675
8.92k
    _operator_profile->set_metadata(_parent->node_id());
676
8.92k
    _wait_for_finish_dependency_timer =
677
8.92k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
8.92k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
8.92k
    if constexpr (!is_fake_shared) {
680
8.92k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
8.92k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
8.92k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
8.92k
            _shared_state = info.shared_state->template cast<SharedState>();
696
8.92k
            _dependency = _shared_state->create_sink_dependency(
697
8.92k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
8.92k
        }
699
8.92k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
8.92k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
8.92k
    }
702
703
8.92k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
8.92k
    _rows_input_counter =
708
8.92k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
8.92k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
8.92k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
8.92k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
8.92k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
8.92k
    _memory_used_counter =
714
8.92k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
8.92k
    _common_profile->add_info_string("IsColocate",
716
8.92k
                                     std::to_string(_parent->is_colocated_operator()));
717
8.92k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
8.92k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
8.92k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
8.92k
    return Status::OK();
721
8.92k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
554
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
554
    _operator_profile =
664
554
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
554
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
554
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
554
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
554
    _operator_profile->add_child(_common_profile, true);
673
554
    _operator_profile->add_child(_custom_profile, true);
674
675
554
    _operator_profile->set_metadata(_parent->node_id());
676
554
    _wait_for_finish_dependency_timer =
677
554
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
554
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
554
    if constexpr (!is_fake_shared) {
680
554
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
554
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
554
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
554
            _shared_state = info.shared_state->template cast<SharedState>();
696
554
            _dependency = _shared_state->create_sink_dependency(
697
554
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
554
        }
699
554
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
554
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
554
    }
702
703
555
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
554
    _rows_input_counter =
708
554
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
554
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
554
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
554
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
554
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
554
    _memory_used_counter =
714
554
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
554
    _common_profile->add_info_string("IsColocate",
716
554
                                     std::to_string(_parent->is_colocated_operator()));
717
554
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
554
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
554
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
554
    return Status::OK();
721
554
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
2.34k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
2.34k
    _operator_profile =
664
2.34k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
2.34k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
2.34k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
2.34k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
2.34k
    _operator_profile->add_child(_common_profile, true);
673
2.34k
    _operator_profile->add_child(_custom_profile, true);
674
675
2.34k
    _operator_profile->set_metadata(_parent->node_id());
676
2.34k
    _wait_for_finish_dependency_timer =
677
2.34k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
2.34k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
2.34k
    if constexpr (!is_fake_shared) {
680
2.34k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
2.34k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
2.34k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
2.34k
            _shared_state = info.shared_state->template cast<SharedState>();
696
2.34k
            _dependency = _shared_state->create_sink_dependency(
697
2.34k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
2.34k
        }
699
2.34k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
2.34k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
2.34k
    }
702
703
2.34k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
2.34k
    _rows_input_counter =
708
2.34k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
2.34k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
2.34k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
2.34k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
2.34k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
2.34k
    _memory_used_counter =
714
2.34k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
2.34k
    _common_profile->add_info_string("IsColocate",
716
2.34k
                                     std::to_string(_parent->is_colocated_operator()));
717
2.34k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
2.34k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
2.34k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
2.34k
    return Status::OK();
721
2.34k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
13.0k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
13.0k
    _operator_profile =
664
13.0k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
13.0k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
13.0k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
13.0k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
13.0k
    _operator_profile->add_child(_common_profile, true);
673
13.0k
    _operator_profile->add_child(_custom_profile, true);
674
675
13.0k
    _operator_profile->set_metadata(_parent->node_id());
676
13.0k
    _wait_for_finish_dependency_timer =
677
13.0k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
13.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
13.0k
    if constexpr (!is_fake_shared) {
680
13.0k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
13.0k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
13.0k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
13.0k
            _shared_state = info.shared_state->template cast<SharedState>();
696
13.0k
            _dependency = _shared_state->create_sink_dependency(
697
13.0k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
13.0k
        }
699
13.0k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
13.0k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
13.0k
    }
702
703
13.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
13.0k
    _rows_input_counter =
708
13.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
13.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
13.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
13.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
13.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
13.0k
    _memory_used_counter =
714
13.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
13.0k
    _common_profile->add_info_string("IsColocate",
716
13.0k
                                     std::to_string(_parent->is_colocated_operator()));
717
13.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
13.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
13.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
13.0k
    return Status::OK();
721
13.0k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
230k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
230k
    _operator_profile =
664
230k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
230k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
230k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
230k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
230k
    _operator_profile->add_child(_common_profile, true);
673
230k
    _operator_profile->add_child(_custom_profile, true);
674
675
230k
    _operator_profile->set_metadata(_parent->node_id());
676
230k
    _wait_for_finish_dependency_timer =
677
230k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
230k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
230k
    if constexpr (!is_fake_shared) {
680
230k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
230k
            info.shared_state_map.end()) {
682
230k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
230k
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
230k
            }
685
230k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
230k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
230k
                                                  ? 0
688
230k
                                                  : info.task_idx]
689
230k
                                  .get();
690
230k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
230k
        } else {
692
27
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
27
                DCHECK(false);
694
27
            }
695
27
            _shared_state = info.shared_state->template cast<SharedState>();
696
27
            _dependency = _shared_state->create_sink_dependency(
697
27
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
27
        }
699
230k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
230k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
230k
    }
702
703
230k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
230k
    _rows_input_counter =
708
230k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
230k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
230k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
230k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
230k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
230k
    _memory_used_counter =
714
230k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
230k
    _common_profile->add_info_string("IsColocate",
716
230k
                                     std::to_string(_parent->is_colocated_operator()));
717
230k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
230k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
230k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
230k
    return Status::OK();
721
230k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
407k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
407k
    _operator_profile =
664
407k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
407k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
407k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
407k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
407k
    _operator_profile->add_child(_common_profile, true);
673
407k
    _operator_profile->add_child(_custom_profile, true);
674
675
407k
    _operator_profile->set_metadata(_parent->node_id());
676
407k
    _wait_for_finish_dependency_timer =
677
407k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
407k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
407k
    if constexpr (!is_fake_shared) {
680
407k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
407k
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
407k
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
407k
            _shared_state = info.shared_state->template cast<SharedState>();
696
407k
            _dependency = _shared_state->create_sink_dependency(
697
407k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
407k
        }
699
407k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
407k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
407k
    }
702
703
407k
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
407k
    _rows_input_counter =
708
407k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
407k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
407k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
407k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
407k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
407k
    _memory_used_counter =
714
407k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
407k
    _common_profile->add_info_string("IsColocate",
716
407k
                                     std::to_string(_parent->is_colocated_operator()));
717
407k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
407k
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
407k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
407k
    return Status::OK();
721
407k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
25
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
25
    _operator_profile =
664
25
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
25
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
25
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
25
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
25
    _operator_profile->add_child(_common_profile, true);
673
25
    _operator_profile->add_child(_custom_profile, true);
674
675
25
    _operator_profile->set_metadata(_parent->node_id());
676
25
    _wait_for_finish_dependency_timer =
677
25
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
25
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
25
    if constexpr (!is_fake_shared) {
680
25
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
25
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
25
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
25
            _shared_state = info.shared_state->template cast<SharedState>();
696
25
            _dependency = _shared_state->create_sink_dependency(
697
25
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
25
        }
699
25
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
25
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
25
    }
702
703
25
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
25
    _rows_input_counter =
708
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
25
    _memory_used_counter =
714
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
25
    _common_profile->add_info_string("IsColocate",
716
25
                                     std::to_string(_parent->is_colocated_operator()));
717
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
25
    return Status::OK();
721
25
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
661
338
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
662
    // create profile
663
338
    _operator_profile =
664
338
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
665
338
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
666
338
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
667
668
    // indentation is true
669
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
670
    // So we should set the indentation to true.
671
338
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
672
338
    _operator_profile->add_child(_common_profile, true);
673
338
    _operator_profile->add_child(_custom_profile, true);
674
675
338
    _operator_profile->set_metadata(_parent->node_id());
676
338
    _wait_for_finish_dependency_timer =
677
338
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
678
338
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
679
338
    if constexpr (!is_fake_shared) {
680
338
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
681
338
            info.shared_state_map.end()) {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
684
            }
685
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
686
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
687
0
                                                  ? 0
688
0
                                                  : info.task_idx]
689
0
                                  .get();
690
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
691
338
        } else {
692
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
693
                DCHECK(false);
694
            }
695
338
            _shared_state = info.shared_state->template cast<SharedState>();
696
338
            _dependency = _shared_state->create_sink_dependency(
697
338
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
698
338
        }
699
338
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
700
338
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
701
338
    }
702
703
338
    if (must_set_shared_state() && _shared_state == nullptr) {
704
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
705
0
    }
706
707
338
    _rows_input_counter =
708
338
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
709
338
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
710
338
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
711
338
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
712
338
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
713
338
    _memory_used_counter =
714
338
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
715
338
    _common_profile->add_info_string("IsColocate",
716
338
                                     std::to_string(_parent->is_colocated_operator()));
717
338
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
718
338
    _common_profile->add_info_string("FollowedByShuffledOperator",
719
338
                                     std::to_string(_parent->followed_by_shuffled_operator()));
720
338
    return Status::OK();
721
338
}
722
723
template <typename SharedState>
724
1.64M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1.64M
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
1.64M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1.16M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1.16M
    }
731
1.64M
    _closed = true;
732
1.64M
    return Status::OK();
733
1.64M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
118k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
118k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
118k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
118k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
118k
    }
731
118k
    _closed = true;
732
118k
    return Status::OK();
733
118k
}
_ZN5doris23PipelineXSinkLocalStateINS_30PartitionedHashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
1
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
1
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
1
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
1
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
1
    }
731
1
    _closed = true;
732
1
    return Status::OK();
733
1
}
_ZN5doris23PipelineXSinkLocalStateINS_15SortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
202k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
202k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
202k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
202k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
202k
    }
731
202k
    _closed = true;
732
202k
    return Status::OK();
733
202k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
26
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
26
    if (_closed) {
726
2
        return Status::OK();
727
2
    }
728
24
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
24
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
24
    }
731
24
    _closed = true;
732
24
    return Status::OK();
733
26
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
6.84k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
6.84k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
6.84k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
6.84k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
6.84k
    }
731
6.84k
    _closed = true;
732
6.84k
    return Status::OK();
733
6.84k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.06k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.06k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.06k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.06k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.06k
    }
731
8.06k
    _closed = true;
732
8.06k
    return Status::OK();
733
8.06k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
96.4k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
96.4k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
96.4k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
96.4k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
96.4k
    }
731
96.4k
    _closed = true;
732
96.4k
    return Status::OK();
733
96.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
62.5k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
62.5k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
62.5k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
62.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
62.5k
    }
731
62.5k
    _closed = true;
732
62.5k
    return Status::OK();
733
62.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
180
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
180
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
180
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
180
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
180
    }
731
180
    _closed = true;
732
180
    return Status::OK();
733
180
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
484k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
484k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
    }
731
484k
    _closed = true;
732
484k
    return Status::OK();
733
484k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
8.92k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
8.92k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
8.92k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
8.92k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
8.92k
    }
731
8.92k
    _closed = true;
732
8.92k
    return Status::OK();
733
8.92k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
452
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
452
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
452
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
452
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
452
    }
731
452
    _closed = true;
732
452
    return Status::OK();
733
452
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
2.34k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
2.34k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
2.34k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
2.34k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
2.34k
    }
731
2.34k
    _closed = true;
732
2.34k
    return Status::OK();
733
2.34k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
13.1k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
13.1k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
13.1k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
13.1k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
13.1k
    }
731
13.1k
    _closed = true;
732
13.1k
    return Status::OK();
733
13.1k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
231k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
231k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
231k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
231k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
231k
    }
731
231k
    _closed = true;
732
231k
    return Status::OK();
733
231k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
408k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
408k
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
408k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
408k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
408k
    }
731
408k
    _closed = true;
732
408k
    return Status::OK();
733
408k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
14
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
14
    }
731
14
    _closed = true;
732
14
    return Status::OK();
733
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
724
338
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
725
338
    if (_closed) {
726
0
        return Status::OK();
727
0
    }
728
338
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
729
338
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
730
338
    }
731
338
    _closed = true;
732
338
    return Status::OK();
733
338
}
734
735
template <typename LocalStateType>
736
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
737
9.25k
                                                          bool* eos) {
738
9.25k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
9.25k
    return pull(state, block, eos);
740
9.25k
}
_ZN5doris18StreamingOperatorXINS_23AssertNumRowsLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
37
                                                          bool* eos) {
738
37
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
37
    return pull(state, block, eos);
740
37
}
_ZN5doris18StreamingOperatorXINS_16SelectLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
737
9.21k
                                                          bool* eos) {
738
9.21k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
739
9.21k
    return pull(state, block, eos);
740
9.21k
}
741
742
template <typename LocalStateType>
743
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
744
512k
                                                         bool* eos) {
745
512k
    auto& local_state = get_local_state(state);
746
512k
    if (need_more_input_data(state)) {
747
479k
        local_state._child_block->clear_column_data(
748
479k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
479k
                        .num_slots());
750
479k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
479k
                state, local_state._child_block.get(), &local_state._child_eos));
752
479k
        *eos = local_state._child_eos;
753
479k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
69.2k
            return Status::OK();
755
69.2k
        }
756
410k
        {
757
410k
            SCOPED_TIMER(local_state.exec_time_counter());
758
410k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
410k
        }
760
410k
    }
761
762
442k
    if (!need_more_input_data(state)) {
763
414k
        SCOPED_TIMER(local_state.exec_time_counter());
764
414k
        bool new_eos = false;
765
414k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
414k
        if (new_eos) {
767
337k
            *eos = true;
768
337k
        } else if (!need_more_input_data(state)) {
769
25.4k
            *eos = false;
770
25.4k
        }
771
414k
    }
772
442k
    return Status::OK();
773
442k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
128k
                                                         bool* eos) {
745
128k
    auto& local_state = get_local_state(state);
746
128k
    if (need_more_input_data(state)) {
747
109k
        local_state._child_block->clear_column_data(
748
109k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
109k
                        .num_slots());
750
109k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
109k
                state, local_state._child_block.get(), &local_state._child_eos));
752
109k
        *eos = local_state._child_eos;
753
109k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
27.2k
            return Status::OK();
755
27.2k
        }
756
82.5k
        {
757
82.5k
            SCOPED_TIMER(local_state.exec_time_counter());
758
82.5k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
82.5k
        }
760
82.5k
    }
761
762
101k
    if (!need_more_input_data(state)) {
763
101k
        SCOPED_TIMER(local_state.exec_time_counter());
764
101k
        bool new_eos = false;
765
101k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
101k
        if (new_eos) {
767
46.2k
            *eos = true;
768
55.2k
        } else if (!need_more_input_data(state)) {
769
11.1k
            *eos = false;
770
11.1k
        }
771
101k
    }
772
101k
    return Status::OK();
773
101k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
4.32k
                                                         bool* eos) {
745
4.32k
    auto& local_state = get_local_state(state);
746
4.32k
    if (need_more_input_data(state)) {
747
2.41k
        local_state._child_block->clear_column_data(
748
2.41k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
2.41k
                        .num_slots());
750
2.41k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
2.41k
                state, local_state._child_block.get(), &local_state._child_eos));
752
2.41k
        *eos = local_state._child_eos;
753
2.41k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
536
            return Status::OK();
755
536
        }
756
1.88k
        {
757
1.88k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.88k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.88k
        }
760
1.88k
    }
761
762
3.79k
    if (!need_more_input_data(state)) {
763
3.79k
        SCOPED_TIMER(local_state.exec_time_counter());
764
3.79k
        bool new_eos = false;
765
3.79k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
3.79k
        if (new_eos) {
767
1.24k
            *eos = true;
768
2.55k
        } else if (!need_more_input_data(state)) {
769
1.90k
            *eos = false;
770
1.90k
        }
771
3.79k
    }
772
3.78k
    return Status::OK();
773
3.78k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
1.85k
                                                         bool* eos) {
745
1.85k
    auto& local_state = get_local_state(state);
746
1.85k
    if (need_more_input_data(state)) {
747
1.85k
        local_state._child_block->clear_column_data(
748
1.85k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
1.85k
                        .num_slots());
750
1.85k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
1.85k
                state, local_state._child_block.get(), &local_state._child_eos));
752
1.85k
        *eos = local_state._child_eos;
753
1.85k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
781
            return Status::OK();
755
781
        }
756
1.07k
        {
757
1.07k
            SCOPED_TIMER(local_state.exec_time_counter());
758
1.07k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
1.07k
        }
760
1.07k
    }
761
762
1.07k
    if (!need_more_input_data(state)) {
763
1.07k
        SCOPED_TIMER(local_state.exec_time_counter());
764
1.07k
        bool new_eos = false;
765
1.07k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
1.07k
        if (new_eos) {
767
793
            *eos = true;
768
793
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
1.07k
    }
772
1.07k
    return Status::OK();
773
1.07k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
16.2k
                                                         bool* eos) {
745
16.2k
    auto& local_state = get_local_state(state);
746
16.2k
    if (need_more_input_data(state)) {
747
16.2k
        local_state._child_block->clear_column_data(
748
16.2k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
16.2k
                        .num_slots());
750
16.2k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
16.2k
                state, local_state._child_block.get(), &local_state._child_eos));
752
16.2k
        *eos = local_state._child_eos;
753
16.2k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
4.01k
            return Status::OK();
755
4.01k
        }
756
12.2k
        {
757
12.2k
            SCOPED_TIMER(local_state.exec_time_counter());
758
12.2k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
12.2k
        }
760
12.2k
    }
761
762
12.2k
    if (!need_more_input_data(state)) {
763
7.07k
        SCOPED_TIMER(local_state.exec_time_counter());
764
7.07k
        bool new_eos = false;
765
7.07k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
7.07k
        if (new_eos) {
767
6.97k
            *eos = true;
768
6.97k
        } else if (!need_more_input_data(state)) {
769
8
            *eos = false;
770
8
        }
771
7.07k
    }
772
12.2k
    return Status::OK();
773
12.2k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
327k
                                                         bool* eos) {
745
327k
    auto& local_state = get_local_state(state);
746
328k
    if (need_more_input_data(state)) {
747
328k
        local_state._child_block->clear_column_data(
748
328k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
328k
                        .num_slots());
750
328k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
328k
                state, local_state._child_block.get(), &local_state._child_eos));
752
328k
        *eos = local_state._child_eos;
753
328k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
34.9k
            return Status::OK();
755
34.9k
        }
756
293k
        {
757
293k
            SCOPED_TIMER(local_state.exec_time_counter());
758
293k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
293k
        }
760
293k
    }
761
762
292k
    if (!need_more_input_data(state)) {
763
269k
        SCOPED_TIMER(local_state.exec_time_counter());
764
269k
        bool new_eos = false;
765
269k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
269k
        if (new_eos) {
767
268k
            *eos = true;
768
268k
        } else if (!need_more_input_data(state)) {
769
0
            *eos = false;
770
0
        }
771
269k
    }
772
292k
    return Status::OK();
773
292k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
23.9k
                                                         bool* eos) {
745
23.9k
    auto& local_state = get_local_state(state);
746
23.9k
    if (need_more_input_data(state)) {
747
11.9k
        local_state._child_block->clear_column_data(
748
11.9k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
11.9k
                        .num_slots());
750
11.9k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
11.9k
                state, local_state._child_block.get(), &local_state._child_eos));
752
11.9k
        *eos = local_state._child_eos;
753
11.9k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
1.06k
            return Status::OK();
755
1.06k
        }
756
10.9k
        {
757
10.9k
            SCOPED_TIMER(local_state.exec_time_counter());
758
10.9k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
10.9k
        }
760
10.9k
    }
761
762
22.9k
    if (!need_more_input_data(state)) {
763
22.3k
        SCOPED_TIMER(local_state.exec_time_counter());
764
22.3k
        bool new_eos = false;
765
22.3k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
22.3k
        if (new_eos) {
767
6.83k
            *eos = true;
768
15.5k
        } else if (!need_more_input_data(state)) {
769
12.0k
            *eos = false;
770
12.0k
        }
771
22.3k
    }
772
22.9k
    return Status::OK();
773
22.9k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
744
9.51k
                                                         bool* eos) {
745
9.51k
    auto& local_state = get_local_state(state);
746
9.51k
    if (need_more_input_data(state)) {
747
9.14k
        local_state._child_block->clear_column_data(
748
9.14k
                OperatorX<LocalStateType>::_child->operator_row_desc_after_projection()
749
9.14k
                        .num_slots());
750
9.14k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
751
9.14k
                state, local_state._child_block.get(), &local_state._child_eos));
752
9.14k
        *eos = local_state._child_eos;
753
9.14k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
754
649
            return Status::OK();
755
649
        }
756
8.49k
        {
757
8.49k
            SCOPED_TIMER(local_state.exec_time_counter());
758
8.49k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
759
8.49k
        }
760
8.49k
    }
761
762
8.85k
    if (!need_more_input_data(state)) {
763
8.85k
        SCOPED_TIMER(local_state.exec_time_counter());
764
8.85k
        bool new_eos = false;
765
8.85k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
766
8.85k
        if (new_eos) {
767
6.46k
            *eos = true;
768
6.46k
        } else if (!need_more_input_data(state)) {
769
366
            *eos = false;
770
366
        }
771
8.85k
    }
772
8.85k
    return Status::OK();
773
8.85k
}
774
775
template <typename Writer, typename Parent>
776
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
777
47.6k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
47.6k
    RETURN_IF_ERROR(Base::init(state, info));
779
47.6k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
47.6k
                                                         "AsyncWriterDependency", true);
781
47.6k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
47.6k
                             _finish_dependency));
783
784
47.6k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
47.6k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
47.6k
    return Status::OK();
787
47.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
356
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
356
    RETURN_IF_ERROR(Base::init(state, info));
779
356
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
356
                                                         "AsyncWriterDependency", true);
781
356
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
356
                             _finish_dependency));
783
784
356
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
356
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
356
    return Status::OK();
787
356
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
47.2k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
47.2k
    RETURN_IF_ERROR(Base::init(state, info));
779
47.2k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
47.2k
                                                         "AsyncWriterDependency", true);
781
47.2k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
47.2k
                             _finish_dependency));
783
784
47.2k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
47.2k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
47.2k
    return Status::OK();
787
47.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
777
48
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
778
48
    RETURN_IF_ERROR(Base::init(state, info));
779
48
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
780
48
                                                         "AsyncWriterDependency", true);
781
48
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
782
48
                             _finish_dependency));
783
784
48
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
785
48
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
786
48
    return Status::OK();
787
48
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
788
789
template <typename Writer, typename Parent>
790
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
791
48.1k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
48.1k
    RETURN_IF_ERROR(Base::open(state));
793
48.1k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
376k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
328k
        RETURN_IF_ERROR(
796
328k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
328k
    }
798
48.1k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
48.1k
    return Status::OK();
800
48.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
356
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
356
    RETURN_IF_ERROR(Base::open(state));
793
356
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
1.85k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
1.49k
        RETURN_IF_ERROR(
796
1.49k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
1.49k
    }
798
356
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
356
    return Status::OK();
800
356
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
47.7k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
47.7k
    RETURN_IF_ERROR(Base::open(state));
793
47.7k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
374k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
326k
        RETURN_IF_ERROR(
796
326k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
326k
    }
798
47.7k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
47.7k
    return Status::OK();
800
47.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
791
48
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
792
48
    RETURN_IF_ERROR(Base::open(state));
793
48
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
794
864
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
795
816
        RETURN_IF_ERROR(
796
816
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
797
816
    }
798
48
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
799
48
    return Status::OK();
800
48
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4openEPNS_12RuntimeStateE
801
802
template <typename Writer, typename Parent>
803
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
804
63.3k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
63.3k
    return _writer->sink(block, eos);
806
63.3k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
1.51k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
1.51k
    return _writer->sink(block, eos);
806
1.51k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
61.7k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
61.7k
    return _writer->sink(block, eos);
806
61.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
804
48
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
805
48
    return _writer->sink(block, eos);
806
48
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
807
808
template <typename Writer, typename Parent>
809
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
810
48.1k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
48.1k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
48.1k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
48.1k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
48.2k
    if (_writer) {
818
48.2k
        Status st = _writer->get_writer_status();
819
48.2k
        if (exec_status.ok()) {
820
48.1k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
48.1k
                                                       : Status::Cancelled("force close"));
822
48.1k
        } else {
823
113
            _writer->force_close(exec_status);
824
113
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
48.2k
        RETURN_IF_ERROR(st);
829
48.2k
    }
830
48.1k
    return Base::close(state, exec_status);
831
48.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
344
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
344
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
344
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
344
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
344
    if (_writer) {
818
344
        Status st = _writer->get_writer_status();
819
344
        if (exec_status.ok()) {
820
344
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
344
                                                       : Status::Cancelled("force close"));
822
344
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
344
        RETURN_IF_ERROR(st);
829
344
    }
830
344
    return Base::close(state, exec_status);
831
344
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
47.7k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
47.7k
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
47.7k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
47.7k
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
47.8k
    if (_writer) {
818
47.8k
        Status st = _writer->get_writer_status();
819
47.8k
        if (exec_status.ok()) {
820
47.7k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
47.7k
                                                       : Status::Cancelled("force close"));
822
47.7k
        } else {
823
113
            _writer->force_close(exec_status);
824
113
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
47.8k
        RETURN_IF_ERROR(st);
829
47.8k
    }
830
47.7k
    return Base::close(state, exec_status);
831
47.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
810
48
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
811
48
    if (_closed) {
812
0
        return Status::OK();
813
0
    }
814
48
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
815
48
    COUNTER_SET(_wait_for_finish_dependency_timer, _finish_dependency->watcher_elapse_time());
816
    // if the init failed, the _writer may be nullptr. so here need check
817
48
    if (_writer) {
818
48
        Status st = _writer->get_writer_status();
819
48
        if (exec_status.ok()) {
820
48
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
821
48
                                                       : Status::Cancelled("force close"));
822
48
        } else {
823
0
            _writer->force_close(exec_status);
824
0
        }
825
        // If there is an error in process_block thread, then we should get the writer
826
        // status before call force_close. For example, the thread may failed in commit
827
        // transaction.
828
48
        RETURN_IF_ERROR(st);
829
48
    }
830
48
    return Base::close(state, exec_status);
831
48
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VHiveTableWriterENS_22HiveTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_25IcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_19VIcebergTableWriterENS_30SpillIcebergTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_18VIcebergDeleteSinkENS_26IcebergDeleteSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_17VIcebergMergeSinkENS_25IcebergMergeSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_14VMCTableWriterENS_20MCTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_15VTVFTableWriterENS_21TVFTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
832
833
// An instantiation added outside the macros below needs the matching
834
// 'extern template' declaration in the operator's header (enforced by
835
// build-support/check-extern-template-pairing.py). Instantiations expanded
836
// through DECLARE_OPERATOR are invisible to that check -- macro bodies are
837
// skipped -- so their extern pairing has to be kept in sync by hand.
838
#define DECLARE_OPERATOR(LOCAL_STATE) template class DataSinkOperatorX<LOCAL_STATE>;
839
DECLARE_OPERATOR(HashJoinBuildSinkLocalState)
840
DECLARE_OPERATOR(ResultSinkLocalState)
841
DECLARE_OPERATOR(JdbcTableSinkLocalState)
842
DECLARE_OPERATOR(MemoryScratchSinkLocalState)
843
DECLARE_OPERATOR(ResultFileSinkLocalState)
844
DECLARE_OPERATOR(OlapTableSinkLocalState)
845
DECLARE_OPERATOR(OlapTableSinkV2LocalState)
846
DECLARE_OPERATOR(HiveTableSinkLocalState)
847
DECLARE_OPERATOR(TVFTableSinkLocalState)
848
DECLARE_OPERATOR(IcebergTableSinkLocalState)
849
DECLARE_OPERATOR(PaimonTableSinkLocalState)
850
DECLARE_OPERATOR(SpillIcebergTableSinkLocalState)
851
DECLARE_OPERATOR(IcebergDeleteSinkLocalState)
852
DECLARE_OPERATOR(IcebergMergeSinkLocalState)
853
DECLARE_OPERATOR(MCTableSinkLocalState)
854
DECLARE_OPERATOR(AnalyticSinkLocalState)
855
DECLARE_OPERATOR(BlackholeSinkLocalState)
856
DECLARE_OPERATOR(SortSinkLocalState)
857
DECLARE_OPERATOR(SpillSortSinkLocalState)
858
DECLARE_OPERATOR(LocalExchangeSinkLocalState)
859
DECLARE_OPERATOR(AggSinkLocalState)
860
DECLARE_OPERATOR(BucketedAggSinkLocalState)
861
DECLARE_OPERATOR(PartitionedAggSinkLocalState)
862
DECLARE_OPERATOR(ExchangeSinkLocalState)
863
DECLARE_OPERATOR(NestedLoopJoinBuildSinkLocalState)
864
DECLARE_OPERATOR(UnionSinkLocalState)
865
DECLARE_OPERATOR(MultiCastDataStreamSinkLocalState)
866
DECLARE_OPERATOR(PartitionSortSinkLocalState)
867
DECLARE_OPERATOR(SetProbeSinkLocalState<true>)
868
DECLARE_OPERATOR(SetProbeSinkLocalState<false>)
869
DECLARE_OPERATOR(SetSinkLocalState<true>)
870
DECLARE_OPERATOR(SetSinkLocalState<false>)
871
DECLARE_OPERATOR(PartitionedHashJoinSinkLocalState)
872
DECLARE_OPERATOR(GroupCommitBlockSinkLocalState)
873
DECLARE_OPERATOR(CacheSinkLocalState)
874
DECLARE_OPERATOR(DictSinkLocalState)
875
DECLARE_OPERATOR(RecCTESinkLocalState)
876
DECLARE_OPERATOR(RecCTEAnchorSinkLocalState)
877
878
#undef DECLARE_OPERATOR
879
880
#define DECLARE_OPERATOR(LOCAL_STATE) template class OperatorX<LOCAL_STATE>;
881
DECLARE_OPERATOR(HashJoinProbeLocalState)
882
DECLARE_OPERATOR(OlapScanLocalState)
883
DECLARE_OPERATOR(GroupCommitLocalState)
884
DECLARE_OPERATOR(JDBCScanLocalState)
885
DECLARE_OPERATOR(FileScanLocalState)
886
DECLARE_OPERATOR(AnalyticLocalState)
887
DECLARE_OPERATOR(SortLocalState)
888
DECLARE_OPERATOR(SpillSortLocalState)
889
DECLARE_OPERATOR(LocalMergeSortLocalState)
890
DECLARE_OPERATOR(AggLocalState)
891
DECLARE_OPERATOR(BucketedAggLocalState)
892
DECLARE_OPERATOR(PartitionedAggLocalState)
893
DECLARE_OPERATOR(TableFunctionLocalState)
894
DECLARE_OPERATOR(ExchangeLocalState)
895
DECLARE_OPERATOR(RepeatLocalState)
896
DECLARE_OPERATOR(NestedLoopJoinProbeLocalState)
897
DECLARE_OPERATOR(AssertNumRowsLocalState)
898
DECLARE_OPERATOR(EmptySetLocalState)
899
DECLARE_OPERATOR(UnionSourceLocalState)
900
DECLARE_OPERATOR(MultiCastDataStreamSourceLocalState)
901
DECLARE_OPERATOR(PartitionSortSourceLocalState)
902
DECLARE_OPERATOR(SetSourceLocalState<true>)
903
DECLARE_OPERATOR(SetSourceLocalState<false>)
904
DECLARE_OPERATOR(DataGenLocalState)
905
DECLARE_OPERATOR(SchemaScanLocalState)
906
DECLARE_OPERATOR(MetaScanLocalState)
907
DECLARE_OPERATOR(LocalExchangeSourceLocalState)
908
DECLARE_OPERATOR(PartitionedHashJoinProbeLocalState)
909
DECLARE_OPERATOR(CacheSourceLocalState)
910
DECLARE_OPERATOR(RecCTESourceLocalState)
911
DECLARE_OPERATOR(RecCTEScanLocalState)
912
913
#ifdef BE_TEST
914
DECLARE_OPERATOR(MockLocalState)
915
DECLARE_OPERATOR(MockScanLocalState)
916
#endif
917
#undef DECLARE_OPERATOR
918
919
template class StreamingOperatorX<AssertNumRowsLocalState>;
920
template class StreamingOperatorX<SelectLocalState>;
921
922
template class StatefulOperatorX<HashJoinProbeLocalState>;
923
template class StatefulOperatorX<PartitionedHashJoinProbeLocalState>;
924
template class StatefulOperatorX<RepeatLocalState>;
925
template class StatefulOperatorX<MaterializationLocalState>;
926
template class StatefulOperatorX<StreamingAggLocalState>;
927
template class StatefulOperatorX<DistinctStreamingAggLocalState>;
928
template class StatefulOperatorX<NestedLoopJoinProbeLocalState>;
929
template class StatefulOperatorX<TableFunctionLocalState>;
930
931
template class PipelineXSinkLocalState<HashJoinSharedState>;
932
template class PipelineXSinkLocalState<PartitionedHashJoinSharedState>;
933
template class PipelineXSinkLocalState<SortSharedState>;
934
template class PipelineXSinkLocalState<SpillSortSharedState>;
935
template class PipelineXSinkLocalState<NestedLoopJoinSharedState>;
936
template class PipelineXSinkLocalState<AnalyticSharedState>;
937
template class PipelineXSinkLocalState<AggSharedState>;
938
template class PipelineXSinkLocalState<BucketedAggSharedState>;
939
template class PipelineXSinkLocalState<PartitionedAggSharedState>;
940
template class PipelineXSinkLocalState<FakeSharedState>;
941
template class PipelineXSinkLocalState<UnionSharedState>;
942
template class PipelineXSinkLocalState<PartitionSortNodeSharedState>;
943
template class PipelineXSinkLocalState<MultiCastSharedState>;
944
template class PipelineXSinkLocalState<SetSharedState>;
945
template class PipelineXSinkLocalState<LocalExchangeSharedState>;
946
template class PipelineXSinkLocalState<BasicSharedState>;
947
template class PipelineXSinkLocalState<DataQueueSharedState>;
948
template class PipelineXSinkLocalState<RecCTESharedState>;
949
950
template class PipelineXLocalState<HashJoinSharedState>;
951
template class PipelineXLocalState<PartitionedHashJoinSharedState>;
952
template class PipelineXLocalState<SortSharedState>;
953
template class PipelineXLocalState<SpillSortSharedState>;
954
template class PipelineXLocalState<NestedLoopJoinSharedState>;
955
template class PipelineXLocalState<AnalyticSharedState>;
956
template class PipelineXLocalState<AggSharedState>;
957
template class PipelineXLocalState<BucketedAggSharedState>;
958
template class PipelineXLocalState<PartitionedAggSharedState>;
959
template class PipelineXLocalState<FakeSharedState>;
960
template class PipelineXLocalState<UnionSharedState>;
961
template class PipelineXLocalState<DataQueueSharedState>;
962
template class PipelineXLocalState<MultiCastSharedState>;
963
template class PipelineXLocalState<PartitionSortNodeSharedState>;
964
template class PipelineXLocalState<SetSharedState>;
965
template class PipelineXLocalState<LocalExchangeSharedState>;
966
template class PipelineXLocalState<BasicSharedState>;
967
template class PipelineXLocalState<RecCTESharedState>;
968
969
template class AsyncWriterSink<doris::VFileResultWriter, ResultFileSinkOperatorX>;
970
template class AsyncWriterSink<doris::VJdbcTableWriter, JdbcTableSinkOperatorX>;
971
template class AsyncWriterSink<doris::VTabletWriter, OlapTableSinkOperatorX>;
972
template class AsyncWriterSink<doris::VTabletWriterV2, OlapTableSinkV2OperatorX>;
973
template class AsyncWriterSink<doris::VHiveTableWriter, HiveTableSinkOperatorX>;
974
template class AsyncWriterSink<doris::VIcebergTableWriter, IcebergTableSinkOperatorX>;
975
template class AsyncWriterSink<doris::VIcebergTableWriter, SpillIcebergTableSinkOperatorX>;
976
template class AsyncWriterSink<doris::VIcebergDeleteSink, IcebergDeleteSinkOperatorX>;
977
template class AsyncWriterSink<doris::VIcebergMergeSink, IcebergMergeSinkOperatorX>;
978
template class AsyncWriterSink<doris::VMCTableWriter, MCTableSinkOperatorX>;
979
template class AsyncWriterSink<doris::VTVFTableWriter, TVFTableSinkOperatorX>;
980
981
#ifdef BE_TEST
982
template class OperatorX<DummyOperatorLocalState>;
983
template class DataSinkOperatorX<DummySinkLocalState>;
984
#endif
985
986
} // namespace doris