Coverage Report

Created: 2026-08-14 19:27

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