Coverage Report

Created: 2026-08-18 17:11

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.66M
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
1.66M
    if (_parent->nereids_id() == -1) {
122
858k
        return fmt::format("(id={})", _parent->node_id());
123
858k
    } else {
124
801k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
801k
    }
126
1.66M
}
_ZNK5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
63.9k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
63.9k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
63.9k
    } else {
124
63.9k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
63.9k
    }
126
63.9k
}
_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
183k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
183k
    if (_parent->nereids_id() == -1) {
122
12
        return fmt::format("(id={})", _parent->node_id());
123
183k
    } else {
124
183k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
183k
    }
126
183k
}
_ZNK5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
25
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
25
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
25
    } else {
124
25
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
25
    }
126
25
}
_ZNK5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.77k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.77k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
5.77k
    } else {
124
5.77k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.77k
    }
126
5.77k
}
_ZNK5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
11.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
11.8k
    if (_parent->nereids_id() == -1) {
122
11
        return fmt::format("(id={})", _parent->node_id());
123
11.8k
    } else {
124
11.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
11.8k
    }
126
11.8k
}
_ZNK5doris19PipelineXLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
83.3k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
83.3k
    if (_parent->nereids_id() == -1) {
122
29
        return fmt::format("(id={})", _parent->node_id());
123
83.2k
    } else {
124
83.2k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
83.2k
    }
126
83.3k
}
_ZNK5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
85.8k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
85.8k
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
85.8k
    } else {
124
85.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
85.8k
    }
126
85.8k
}
_ZNK5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
142
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
142
    if (_parent->nereids_id() == -1) {
122
0
        return fmt::format("(id={})", _parent->node_id());
123
142
    } else {
124
142
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
142
    }
126
142
}
_ZNK5doris19PipelineXLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
577k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
577k
    if (_parent->nereids_id() == -1) {
122
266k
        return fmt::format("(id={})", _parent->node_id());
123
310k
    } else {
124
310k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
310k
    }
126
577k
}
_ZNK5doris19PipelineXLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
51.1k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
51.1k
    if (_parent->nereids_id() == -1) {
122
2
        return fmt::format("(id={})", _parent->node_id());
123
51.1k
    } else {
124
51.1k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
51.1k
    }
126
51.1k
}
_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.90k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
4.90k
    if (_parent->nereids_id() == -1) {
122
4.90k
        return fmt::format("(id={})", _parent->node_id());
123
4.90k
    } else {
124
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
0
    }
126
4.90k
}
_ZNK5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
531
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
531
    if (_parent->nereids_id() == -1) {
122
102
        return fmt::format("(id={})", _parent->node_id());
123
429
    } else {
124
429
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
429
    }
126
531
}
_ZNK5doris19PipelineXLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
5.13k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
5.13k
    if (_parent->nereids_id() == -1) {
122
13
        return fmt::format("(id={})", _parent->node_id());
123
5.12k
    } else {
124
5.12k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
5.12k
    }
126
5.13k
}
_ZNK5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
120
586k
std::string PipelineXLocalState<SharedStateArg>::name_suffix() const {
121
587k
    if (_parent->nereids_id() == -1) {
122
587k
        return fmt::format("(id={})", _parent->node_id());
123
18.4E
    } else {
124
18.4E
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
125
18.4E
    }
126
586k
}
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.14M
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
1.14M
    if (_parent->nereids_id() == -1) {
131
652k
        return fmt::format("(id={})", _parent->node_id());
132
652k
    } else {
133
490k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
490k
    }
135
1.14M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
112k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
112k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
112k
    } else {
133
112k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
112k
    }
135
112k
}
_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
185k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
185k
    if (_parent->nereids_id() == -1) {
131
9
        return fmt::format("(id={})", _parent->node_id());
132
185k
    } else {
133
185k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
185k
    }
135
185k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
32
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
32
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
32
    } else {
133
32
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
32
    }
135
32
}
_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
11.9k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
11.9k
    if (_parent->nereids_id() == -1) {
131
11
        return fmt::format("(id={})", _parent->node_id());
132
11.8k
    } else {
133
11.8k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
11.8k
    }
135
11.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
83.4k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
83.4k
    if (_parent->nereids_id() == -1) {
131
29
        return fmt::format("(id={})", _parent->node_id());
132
83.4k
    } else {
133
83.4k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
83.4k
    }
135
83.4k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
85.7k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
85.7k
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
85.7k
    } else {
133
85.7k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
85.7k
    }
135
85.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
152
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
152
    if (_parent->nereids_id() == -1) {
131
0
        return fmt::format("(id={})", _parent->node_id());
132
152
    } else {
133
152
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
152
    }
135
152
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
18
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
18
    if (_parent->nereids_id() == -1) {
131
18
        return fmt::format("(id={})", _parent->node_id());
132
18
    } else {
133
0
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
0
    }
135
18
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
5.38k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
5.38k
    if (_parent->nereids_id() == -1) {
131
3
        return fmt::format("(id={})", _parent->node_id());
132
5.38k
    } else {
133
5.38k
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
5.38k
    }
135
5.38k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
535
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
535
    if (_parent->nereids_id() == -1) {
131
102
        return fmt::format("(id={})", _parent->node_id());
132
433
    } else {
133
433
        return fmt::format("(nereids_id={}, id={})", _parent->nereids_id(), _parent->node_id());
134
433
    }
135
535
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE11name_suffixB5cxx11Ev
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
12.5k
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.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
224k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
224k
    if (_parent->nereids_id() == -1) {
131
224k
        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
224k
}
_ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE11name_suffixB5cxx11Ev
Line
Count
Source
129
415k
std::string PipelineXSinkLocalState<SharedStateArg>::name_suffix() {
130
415k
    if (_parent->nereids_id() == -1) {
131
415k
        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
415k
}
_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
29.9k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
29.9k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
29.9k
    _terminated = true;
143
29.9k
    return Status::OK();
144
29.9k
}
_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
2.08k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
2.08k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
2.08k
    _terminated = true;
143
2.08k
    return Status::OK();
144
2.08k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_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_25NestedLoopJoinSharedStateEE9terminateEPNS_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_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
3
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
3
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
3
    _terminated = true;
143
3
    return Status::OK();
144
3
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
1.92k
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
1.92k
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
1.92k
    _terminated = true;
143
1.92k
    return Status::OK();
144
1.92k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
947
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
947
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
947
    _terminated = true;
143
947
    return Status::OK();
144
947
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
358
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
358
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
358
    _terminated = true;
143
358
    return Status::OK();
144
358
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
34
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
34
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
34
    _terminated = true;
143
34
    return Status::OK();
144
34
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
4
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
4
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
4
    _terminated = true;
143
4
    return Status::OK();
144
4
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
296
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
296
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
296
    _terminated = true;
143
296
    return Status::OK();
144
296
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
6
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
6
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
6
    _terminated = true;
143
6
    return Status::OK();
144
6
}
_ZN5doris23PipelineXSinkLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
176
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
176
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
176
    _terminated = true;
143
176
    return Status::OK();
144
176
}
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
138
130
Status PipelineXSinkLocalState<SharedStateArg>::terminate(RuntimeState* state) {
139
130
    if (_terminated) {
140
0
        return Status::OK();
141
0
    }
142
130
    _terminated = true;
143
130
    return Status::OK();
144
130
}
145
146
277k
DataDistribution OperatorBase::required_data_distribution(RuntimeState* /*state*/) const {
147
277k
    return _child && _child->is_serial_operator() && !is_source()
148
277k
                   ? DataDistribution(TLocalPartitionType::PASSTHROUGH)
149
277k
                   : DataDistribution(TLocalPartitionType::NOOP);
150
277k
}
151
152
19.9k
bool OperatorBase::child_breaks_local_key_distribution(RuntimeState* state) const {
153
19.9k
    if (!_child) {
154
18.6k
        return false;
155
18.6k
    }
156
1.35k
    if (_child->is_serial_operator()) {
157
156
        return true;
158
156
    }
159
1.19k
    const auto child_distribution = _child->required_data_distribution(state);
160
1.19k
    return child_distribution.need_local_exchange() &&
161
1.19k
           !is_shuffled_exchange(child_distribution.distribution_type);
162
1.35k
}
163
164
81.9k
const RowDescriptor& OperatorBase::row_desc() const {
165
81.9k
    return _child->row_desc();
166
81.9k
}
167
168
template <typename SharedStateArg>
169
19.9k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
19.9k
    fmt::memory_buffer debug_string_buffer;
171
19.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
19.9k
    return fmt::to_string(debug_string_buffer);
173
19.9k
}
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.9k
std::string PipelineXLocalState<SharedStateArg>::debug_string(int indentation_level) const {
170
19.9k
    fmt::memory_buffer debug_string_buffer;
171
19.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
172
19.9k
    return fmt::to_string(debug_string_buffer);
173
19.9k
}
_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.9k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
19.9k
    fmt::memory_buffer debug_string_buffer;
178
19.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
19.9k
    return fmt::to_string(debug_string_buffer);
180
19.9k
}
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.9k
std::string PipelineXSinkLocalState<SharedStateArg>::debug_string(int indentation_level) const {
177
19.9k
    fmt::memory_buffer debug_string_buffer;
178
19.9k
    fmt::format_to(debug_string_buffer, "{}", _parent->debug_string(indentation_level));
179
19.9k
    return fmt::to_string(debug_string_buffer);
180
19.9k
}
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE12debug_stringB5cxx11Ei
Unexecuted instantiation: _ZNK5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE12debug_stringB5cxx11Ei
181
182
19.9k
std::string OperatorXBase::debug_string(int indentation_level) const {
183
19.9k
    fmt::memory_buffer debug_string_buffer;
184
19.9k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, parallel_tasks={}, _is_serial_operator={}",
185
19.9k
                   std::string(indentation_level * 2, ' '), _op_name, node_id(), _parallel_tasks,
186
19.9k
                   _is_serial_operator);
187
19.9k
    return fmt::to_string(debug_string_buffer);
188
19.9k
}
189
190
19.9k
std::string OperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
191
19.9k
    return state->get_local_state(operator_id())->debug_string(indentation_level);
192
19.9k
}
193
194
595k
Status OperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
195
595k
    std::string node_name = print_plan_node_type(tnode.node_type);
196
595k
    _nereids_id = tnode.nereids_id;
197
595k
    if (!tnode.intermediate_output_tuple_id_list.empty()) {
198
3.18k
        if (!tnode.__isset.output_tuple_id) {
199
0
            return Status::InternalError("no final output tuple id");
200
0
        }
201
3.18k
        if (tnode.intermediate_output_tuple_id_list.size() !=
202
3.18k
            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.18k
    }
210
595k
    auto substr = node_name.substr(0, node_name.find("_NODE"));
211
595k
    _op_name = substr + "_OPERATOR";
212
213
595k
    if (tnode.__isset.vconjunct) {
214
0
        return Status::InternalError("vconjunct is not supported yet");
215
595k
    } else if (tnode.__isset.conjuncts) {
216
253k
        for (const auto& conjunct : tnode.conjuncts) {
217
253k
            VExprContextSPtr context;
218
253k
            RETURN_IF_ERROR(VExpr::create_expr_tree(conjunct, context));
219
253k
            _conjuncts.emplace_back(context);
220
253k
        }
221
86.6k
    }
222
223
    // create the projections expr
224
595k
    if (tnode.__isset.projections) {
225
236k
        DCHECK(tnode.__isset.output_tuple_id);
226
236k
        RETURN_IF_ERROR(VExpr::create_expr_trees(tnode.projections, _projections));
227
236k
    }
228
595k
    if (!tnode.intermediate_projections_list.empty()) {
229
3.18k
        DCHECK(tnode.__isset.projections) << "no final projections";
230
3.18k
        _intermediate_projections.reserve(tnode.intermediate_projections_list.size());
231
4.22k
        for (const auto& tnode_projections : tnode.intermediate_projections_list) {
232
4.22k
            VExprContextSPtrs projections;
233
4.22k
            RETURN_IF_ERROR(VExpr::create_expr_trees(tnode_projections, projections));
234
4.22k
            _intermediate_projections.push_back(projections);
235
4.22k
        }
236
3.18k
    }
237
595k
    return Status::OK();
238
595k
}
239
240
621k
Status OperatorXBase::prepare(RuntimeState* state) {
241
621k
    for (auto& conjunct : _conjuncts) {
242
253k
        RETURN_IF_ERROR(conjunct->prepare(state, intermediate_row_desc()));
243
253k
    }
244
621k
    if (state->enable_adjust_conjunct_order_by_cost()) {
245
571k
        std::ranges::stable_sort(_conjuncts, [](const auto& a, const auto& b) {
246
327k
            return a->execute_cost() < b->execute_cost();
247
327k
        });
248
571k
    };
249
250
626k
    for (int i = 0; i < _intermediate_projections.size(); i++) {
251
4.22k
        RETURN_IF_ERROR(
252
4.22k
                VExpr::prepare(_intermediate_projections[i], state, intermediate_row_desc(i)));
253
4.22k
    }
254
621k
    RETURN_IF_ERROR(VExpr::prepare(_projections, state, projections_row_desc()));
255
256
621k
    if (has_output_row_desc()) {
257
236k
        RETURN_IF_ERROR(VExpr::check_expr_output_type(_projections, *_output_row_descriptor));
258
236k
    }
259
260
621k
    for (auto& conjunct : _conjuncts) {
261
253k
        RETURN_IF_ERROR(conjunct->open(state));
262
253k
    }
263
621k
    RETURN_IF_ERROR(VExpr::open(_projections, state));
264
621k
    for (auto& projections : _intermediate_projections) {
265
4.22k
        RETURN_IF_ERROR(VExpr::open(projections, state));
266
4.22k
    }
267
621k
    if (_child && !is_source()) {
268
88.7k
        RETURN_IF_ERROR(_child->prepare(state));
269
88.7k
    }
270
271
621k
    if (VExpr::contains_blockable_function(_conjuncts) ||
272
621k
        VExpr::contains_blockable_function(_projections)) {
273
0
        _blockable = true;
274
0
    }
275
276
621k
    return Status::OK();
277
621k
}
278
279
6.90k
Status OperatorXBase::terminate(RuntimeState* state) {
280
6.90k
    if (_child && !is_source()) {
281
912
        RETURN_IF_ERROR(_child->terminate(state));
282
912
    }
283
6.90k
    auto result = state->get_local_state_result(operator_id());
284
6.90k
    if (!result) {
285
0
        return result.error();
286
0
    }
287
6.90k
    return result.value()->terminate(state);
288
6.90k
}
289
290
4.51M
Status OperatorXBase::close(RuntimeState* state) {
291
4.51M
    if (_child && !is_source()) {
292
752k
        RETURN_IF_ERROR(_child->close(state));
293
752k
    }
294
4.51M
    auto result = state->get_local_state_result(operator_id());
295
4.51M
    if (!result) {
296
0
        return result.error();
297
0
    }
298
4.51M
    return result.value()->close(state);
299
4.51M
}
300
301
247k
void PipelineXLocalStateBase::clear_origin_block() {
302
247k
    _origin_block.clear_column_data(_parent->intermediate_row_desc().num_materialized_slots());
303
247k
}
304
305
846k
Status PipelineXLocalStateBase::filter_block(const VExprContextSPtrs& expr_contexts, Block* block) {
306
846k
    RETURN_IF_ERROR(VExprContext::filter_block(expr_contexts, block, block->columns()));
307
308
846k
    _estimate_memory_usage += VExprContext::get_memory_usage(expr_contexts);
309
846k
    return Status::OK();
310
846k
}
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
247k
                                     Block* output_block) const {
319
247k
    auto* local_state = state->get_local_state(operator_id());
320
247k
    SCOPED_TIMER(local_state->exec_time_counter());
321
247k
    SCOPED_TIMER(local_state->_projection_timer);
322
247k
    const size_t rows = origin_block->rows();
323
247k
    if (rows == 0) {
324
129k
        return Status::OK();
325
129k
    }
326
117k
    SCOPED_PEAK_MEM(&local_state->_estimate_memory_usage);
327
328
117k
    {
329
117k
        Block input_block = *origin_block;
330
331
117k
        ColumnsWithTypeAndName new_columns;
332
117k
        for (const auto& projections : local_state->_intermediate_projections) {
333
1.17k
            if (projections.empty()) {
334
0
                return Status::InternalError("meet empty intermediate projection, node id: {}",
335
0
                                             node_id());
336
0
            }
337
1.17k
            new_columns.resize(projections.size());
338
7.39k
            for (int i = 0; i < projections.size(); i++) {
339
6.21k
                RETURN_IF_ERROR(projections[i]->execute(&input_block, new_columns[i]));
340
6.21k
                if (new_columns[i].column->size() != rows) {
341
0
                    return Status::InternalError(
342
0
                            "intermediate projection result column size {} not equal input rows "
343
0
                            "{}, expr: {}",
344
0
                            new_columns[i].column->size(), rows,
345
0
                            projections[i]->root()->debug_string());
346
0
                }
347
6.21k
            }
348
1.17k
            Block tmp_block {new_columns};
349
1.17k
            input_block.swap(tmp_block);
350
1.17k
        }
351
352
117k
        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
117k
        auto scoped_mutable_block = VectorizedUtils::build_scoped_mutable_mem_reuse_block(
360
117k
                output_block, *_output_row_descriptor);
361
117k
        auto& mutable_columns = scoped_mutable_block.mutable_columns();
362
117k
        DCHECK_EQ(mutable_columns.size(), local_state->_projections.size()) << debug_string();
363
117k
        Columns shared_columns(mutable_columns.size());
364
365
665k
        for (int i = 0; i < mutable_columns.size(); ++i) {
366
547k
            ColumnPtr column_ptr;
367
547k
            RETURN_IF_ERROR(local_state->_projections[i]->execute(&input_block, column_ptr));
368
547k
            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
547k
            column_ptr = column_ptr->convert_to_full_column_if_const();
375
547k
            if (is_column_nullable(*mutable_columns[i]) && !is_column_nullable(*column_ptr)) {
376
0
                column_ptr = make_nullable(column_ptr, false);
377
0
            }
378
547k
            if (column_ptr->is_exclusive()) {
379
199k
                mutable_columns[i] = IColumn::mutate(std::move(column_ptr));
380
348k
            } else {
381
348k
                shared_columns[i] = std::move(column_ptr);
382
348k
            }
383
547k
        }
384
385
117k
        scoped_mutable_block.restore();
386
665k
        for (int i = 0; i < shared_columns.size(); ++i) {
387
547k
            if (shared_columns[i]) {
388
348k
                output_block->replace_by_position(i, std::move(shared_columns[i]));
389
348k
            }
390
547k
        }
391
117k
    }
392
393
0
    origin_block->clear_column_data(
394
117k
            local_state->_parent->intermediate_row_desc().num_materialized_slots());
395
117k
    DCHECK_EQ(output_block->rows(), rows);
396
397
117k
    return Status::OK();
398
117k
}
399
400
4.28M
Status OperatorXBase::get_block_after_projects(RuntimeState* state, Block* block, bool* eos) {
401
4.28M
    DBUG_EXECUTE_IF("Pipeline::return_empty_block", {
402
4.28M
        if (this->_op_name == "AGGREGATION_OPERATOR" || this->_op_name == "HASH_JOIN_OPERATOR" ||
403
4.28M
            this->_op_name == "PARTITIONED_AGGREGATION_OPERATOR" ||
404
4.28M
            this->_op_name == "PARTITIONED_HASH_JOIN_OPERATOR" ||
405
4.28M
            this->_op_name == "CROSS_JOIN_OPERATOR" || this->_op_name == "SORT_OPERATOR") {
406
4.28M
            if (_debug_point_count++ % 2 == 0) {
407
4.28M
                return Status::OK();
408
4.28M
            }
409
4.28M
        }
410
4.28M
    });
411
412
4.28M
    Status status;
413
4.28M
    auto* local_state = state->get_local_state(operator_id());
414
4.28M
    Defer defer([&]() {
415
4.28M
        if (status.ok()) {
416
4.28M
            local_state->update_output_block_counters(*block);
417
4.28M
        }
418
4.28M
    });
419
4.28M
    if (_output_row_descriptor) {
420
247k
        local_state->clear_origin_block();
421
247k
        status = get_block(state, &local_state->_origin_block, eos);
422
247k
        if (UNLIKELY(!status.ok())) {
423
20
            return status;
424
20
        }
425
247k
        status = do_projections(state, &local_state->_origin_block, block);
426
247k
        return status;
427
247k
    }
428
4.04M
    status = get_block(state, block, eos);
429
4.04M
    RETURN_IF_ERROR(block->check_type_and_column());
430
4.04M
    return status;
431
4.04M
}
432
433
2.62M
void PipelineXLocalStateBase::reached_limit(Block* block, bool* eos) {
434
2.62M
    if (_parent->_limit != -1 and _num_rows_returned + block->rows() >= _parent->_limit) {
435
3.61k
        block->set_num_rows(_parent->_limit - _num_rows_returned);
436
3.61k
        *eos = true;
437
3.61k
    }
438
439
2.62M
    DBUG_EXECUTE_IF("Pipeline::reached_limit_early", {
440
2.62M
        auto op_name = to_lower(_parent->_op_name);
441
2.62M
        auto arg_op_name = dp->param<std::string>("op_name");
442
2.62M
        arg_op_name = to_lower(arg_op_name);
443
444
2.62M
        if (op_name == arg_op_name) {
445
2.62M
            *eos = true;
446
2.62M
        }
447
2.62M
    });
448
449
2.62M
    if (auto rows = block->rows()) {
450
686k
        _num_rows_returned += rows;
451
686k
        _state->get_query_ctx()->resource_ctx()->io_context()->update_process_rows(rows);
452
686k
    }
453
2.62M
}
454
455
29.9k
Status DataSinkOperatorXBase::terminate(RuntimeState* state) {
456
29.9k
    auto result = state->get_sink_local_state_result();
457
29.9k
    if (!result) {
458
0
        return result.error();
459
0
    }
460
29.9k
    return result.value()->terminate(state);
461
29.9k
}
462
463
19.9k
std::string DataSinkOperatorXBase::debug_string(int indentation_level) const {
464
19.9k
    fmt::memory_buffer debug_string_buffer;
465
466
19.9k
    fmt::format_to(debug_string_buffer, "{}{}: id={}, _is_serial_operator={}",
467
19.9k
                   std::string(indentation_level * 2, ' '), _name, node_id(), _is_serial_operator);
468
19.9k
    return fmt::to_string(debug_string_buffer);
469
19.9k
}
470
471
19.9k
std::string DataSinkOperatorXBase::debug_string(RuntimeState* state, int indentation_level) const {
472
19.9k
    return state->get_sink_local_state()->debug_string(indentation_level);
473
19.9k
}
474
475
311k
Status DataSinkOperatorXBase::init(const TDataSink& tsink) {
476
311k
    std::string op_name = "UNKNOWN_SINK";
477
311k
    auto it = _TDataSinkType_VALUES_TO_NAMES.find(tsink.type);
478
479
311k
    if (it != _TDataSinkType_VALUES_TO_NAMES.end()) {
480
311k
        op_name = it->second;
481
311k
    }
482
311k
    _name = op_name + "_OPERATOR";
483
311k
    return Status::OK();
484
311k
}
485
486
267k
Status DataSinkOperatorXBase::init(const TPlanNode& tnode, RuntimeState* state) {
487
267k
    std::string op_name = print_plan_node_type(tnode.node_type);
488
267k
    _nereids_id = tnode.nereids_id;
489
267k
    auto substr = op_name.substr(0, op_name.find("_NODE"));
490
267k
    _name = substr + "_SINK_OPERATOR";
491
267k
    return Status::OK();
492
267k
}
493
494
template <typename LocalStateType>
495
Status DataSinkOperatorX<LocalStateType>::setup_local_state(RuntimeState* state,
496
1.59M
                                                            LocalSinkStateInfo& info) {
497
1.59M
    auto local_state = LocalStateType::create_unique(this, state);
498
1.59M
    RETURN_IF_ERROR(local_state->init(state, info));
499
1.59M
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
1.59M
    return Status::OK();
501
1.59M
}
_ZN5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
112k
                                                            LocalSinkStateInfo& info) {
497
112k
    auto local_state = LocalStateType::create_unique(this, state);
498
112k
    RETURN_IF_ERROR(local_state->init(state, info));
499
112k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
112k
    return Status::OK();
501
112k
}
_ZN5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
370k
                                                            LocalSinkStateInfo& info) {
497
370k
    auto local_state = LocalStateType::create_unique(this, state);
498
370k
    RETURN_IF_ERROR(local_state->init(state, info));
499
370k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
370k
    return Status::OK();
501
370k
}
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
379
                                                            LocalSinkStateInfo& info) {
497
379
    auto local_state = LocalStateType::create_unique(this, state);
498
379
    RETURN_IF_ERROR(local_state->init(state, info));
499
379
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
379
    return Status::OK();
501
379
}
_ZN5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
43.4k
                                                            LocalSinkStateInfo& info) {
497
43.4k
    auto local_state = LocalStateType::create_unique(this, state);
498
43.4k
    RETURN_IF_ERROR(local_state->init(state, info));
499
43.4k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
43.4k
    return Status::OK();
501
43.4k
}
_ZN5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
56
                                                            LocalSinkStateInfo& info) {
497
56
    auto local_state = LocalStateType::create_unique(this, state);
498
56
    RETURN_IF_ERROR(local_state->init(state, info));
499
56
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
56
    return Status::OK();
501
56
}
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
11.8k
                                                            LocalSinkStateInfo& info) {
497
11.8k
    auto local_state = LocalStateType::create_unique(this, state);
498
11.8k
    RETURN_IF_ERROR(local_state->init(state, info));
499
11.8k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
11.8k
    return Status::OK();
501
11.8k
}
_ZN5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
15
                                                            LocalSinkStateInfo& info) {
497
15
    auto local_state = LocalStateType::create_unique(this, state);
498
15
    RETURN_IF_ERROR(local_state->init(state, info));
499
15
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
15
    return Status::OK();
501
15
}
_ZN5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
185k
                                                            LocalSinkStateInfo& info) {
497
185k
    auto local_state = LocalStateType::create_unique(this, state);
498
185k
    RETURN_IF_ERROR(local_state->init(state, info));
499
185k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
185k
    return Status::OK();
501
185k
}
_ZN5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
32
                                                            LocalSinkStateInfo& info) {
497
32
    auto local_state = LocalStateType::create_unique(this, state);
498
32
    RETURN_IF_ERROR(local_state->init(state, info));
499
32
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
32
    return Status::OK();
501
32
}
_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
83.5k
                                                            LocalSinkStateInfo& info) {
497
83.5k
    auto local_state = LocalStateType::create_unique(this, state);
498
83.5k
    RETURN_IF_ERROR(local_state->init(state, info));
499
83.5k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
83.5k
    return Status::OK();
501
83.5k
}
_ZN5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
85.7k
                                                            LocalSinkStateInfo& info) {
497
85.7k
    auto local_state = LocalStateType::create_unique(this, state);
498
85.7k
    RETURN_IF_ERROR(local_state->init(state, info));
499
85.7k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
85.7k
    return Status::OK();
501
85.7k
}
_ZN5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
152
                                                            LocalSinkStateInfo& info) {
497
152
    auto local_state = LocalStateType::create_unique(this, state);
498
152
    RETURN_IF_ERROR(local_state->init(state, info));
499
152
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
152
    return Status::OK();
501
152
}
_ZN5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
454k
                                                            LocalSinkStateInfo& info) {
497
454k
    auto local_state = LocalStateType::create_unique(this, state);
498
454k
    RETURN_IF_ERROR(local_state->init(state, info));
499
454k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
454k
    return Status::OK();
501
454k
}
_ZN5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
5.80k
                                                            LocalSinkStateInfo& info) {
497
5.80k
    auto local_state = LocalStateType::create_unique(this, state);
498
5.80k
    RETURN_IF_ERROR(local_state->init(state, info));
499
5.80k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
5.80k
    return Status::OK();
501
5.80k
}
_ZN5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
5.38k
                                                            LocalSinkStateInfo& info) {
497
5.38k
    auto local_state = LocalStateType::create_unique(this, state);
498
5.38k
    RETURN_IF_ERROR(local_state->init(state, info));
499
5.38k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
5.38k
    return Status::OK();
501
5.38k
}
_ZN5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
1.98k
                                                            LocalSinkStateInfo& info) {
497
1.98k
    auto local_state = LocalStateType::create_unique(this, state);
498
1.98k
    RETURN_IF_ERROR(local_state->init(state, info));
499
1.98k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
1.98k
    return Status::OK();
501
1.98k
}
_ZN5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
432
                                                            LocalSinkStateInfo& info) {
497
432
    auto local_state = LocalStateType::create_unique(this, state);
498
432
    RETURN_IF_ERROR(local_state->init(state, info));
499
432
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
432
    return Status::OK();
501
432
}
_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.54k
                                                            LocalSinkStateInfo& info) {
497
2.54k
    auto local_state = LocalStateType::create_unique(this, state);
498
2.54k
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.54k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.54k
    return Status::OK();
501
2.54k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
2.63k
                                                            LocalSinkStateInfo& info) {
497
2.63k
    auto local_state = LocalStateType::create_unique(this, state);
498
2.63k
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.63k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.63k
    return Status::OK();
501
2.63k
}
_ZN5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
496
2.46k
                                                            LocalSinkStateInfo& info) {
497
2.46k
    auto local_state = LocalStateType::create_unique(this, state);
498
2.46k
    RETURN_IF_ERROR(local_state->init(state, info));
499
2.46k
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
2.46k
    return Status::OK();
501
2.46k
}
_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
558
                                                            LocalSinkStateInfo& info) {
497
558
    auto local_state = LocalStateType::create_unique(this, state);
498
558
    RETURN_IF_ERROR(local_state->init(state, info));
499
558
    state->emplace_sink_local_state(operator_id(), std::move(local_state));
500
558
    return Status::OK();
501
558
}
_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.26M
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.26M
    } else {
512
1.26M
        auto ss = LocalStateType::SharedStateType::create_shared();
513
1.26M
        ss->id = operator_id();
514
1.26M
        for (auto& dest : dests_id()) {
515
1.25M
            ss->related_op_ids.insert(dest);
516
1.25M
        }
517
1.26M
        return ss;
518
1.26M
    }
519
1.26M
}
_ZNK5doris17DataSinkOperatorXINS_27HashJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
98.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
98.8k
    } else {
512
98.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
98.8k
        ss->id = operator_id();
514
98.8k
        for (auto& dest : dests_id()) {
515
98.8k
            ss->related_op_ids.insert(dest);
516
98.8k
        }
517
98.8k
        return ss;
518
98.8k
    }
519
98.8k
}
_ZNK5doris17DataSinkOperatorXINS_20ResultSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
371k
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
371k
    } else {
512
371k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
371k
        ss->id = operator_id();
514
371k
        for (auto& dest : dests_id()) {
515
370k
            ss->related_op_ids.insert(dest);
516
370k
        }
517
371k
        return ss;
518
371k
    }
519
371k
}
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
379
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
379
    } else {
512
379
        auto ss = LocalStateType::SharedStateType::create_shared();
513
379
        ss->id = operator_id();
514
379
        for (auto& dest : dests_id()) {
515
376
            ss->related_op_ids.insert(dest);
516
376
        }
517
379
        return ss;
518
379
    }
519
379
}
_ZNK5doris17DataSinkOperatorXINS_23OlapTableSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
43.5k
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
43.5k
    } else {
512
43.5k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
43.5k
        ss->id = operator_id();
514
43.5k
        for (auto& dest : dests_id()) {
515
43.2k
            ss->related_op_ids.insert(dest);
516
43.2k
        }
517
43.5k
        return ss;
518
43.5k
    }
519
43.5k
}
_ZNK5doris17DataSinkOperatorXINS_25OlapTableSinkV2LocalStateEE19create_shared_stateEv
Line
Count
Source
504
56
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
56
    } else {
512
56
        auto ss = LocalStateType::SharedStateType::create_shared();
513
56
        ss->id = operator_id();
514
56
        for (auto& dest : dests_id()) {
515
56
            ss->related_op_ids.insert(dest);
516
56
        }
517
56
        return ss;
518
56
    }
519
56
}
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
11.9k
std::shared_ptr<BasicSharedState> DataSinkOperatorX<LocalStateType>::create_shared_state() const {
505
    if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
506
                                 LocalExchangeSharedState>) {
507
        return nullptr;
508
    } else if constexpr (std::is_same_v<typename LocalStateType::SharedStateType,
509
                                        MultiCastSharedState>) {
510
        throw Exception(Status::FatalError("should not reach here!"));
511
11.9k
    } else {
512
11.9k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
11.9k
        ss->id = operator_id();
514
11.9k
        for (auto& dest : dests_id()) {
515
11.9k
            ss->related_op_ids.insert(dest);
516
11.9k
        }
517
11.9k
        return ss;
518
11.9k
    }
519
11.9k
}
_ZNK5doris17DataSinkOperatorXINS_23BlackholeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
15
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
15
    } else {
512
15
        auto ss = LocalStateType::SharedStateType::create_shared();
513
15
        ss->id = operator_id();
514
15
        for (auto& dest : dests_id()) {
515
15
            ss->related_op_ids.insert(dest);
516
15
        }
517
15
        return ss;
518
15
    }
519
15
}
_ZNK5doris17DataSinkOperatorXINS_18SortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
186k
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
186k
    } else {
512
186k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
186k
        ss->id = operator_id();
514
186k
        for (auto& dest : dests_id()) {
515
185k
            ss->related_op_ids.insert(dest);
516
185k
        }
517
186k
        return ss;
518
186k
    }
519
186k
}
_ZNK5doris17DataSinkOperatorXINS_23SpillSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
34
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
34
    } else {
512
34
        auto ss = LocalStateType::SharedStateType::create_shared();
513
34
        ss->id = operator_id();
514
34
        for (auto& dest : dests_id()) {
515
34
            ss->related_op_ids.insert(dest);
516
34
        }
517
34
        return ss;
518
34
    }
519
34
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_27LocalExchangeSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17AggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
83.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
83.8k
    } else {
512
83.8k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
83.8k
        ss->id = operator_id();
514
83.8k
        for (auto& dest : dests_id()) {
515
83.8k
            ss->related_op_ids.insert(dest);
516
83.8k
        }
517
83.8k
        return ss;
518
83.8k
    }
519
83.8k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_25BucketedAggSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_28PartitionedAggSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
151
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
151
    } else {
512
151
        auto ss = LocalStateType::SharedStateType::create_shared();
513
151
        ss->id = operator_id();
514
151
        for (auto& dest : dests_id()) {
515
151
            ss->related_op_ids.insert(dest);
516
151
        }
517
151
        return ss;
518
151
    }
519
151
}
_ZNK5doris17DataSinkOperatorXINS_22ExchangeSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
455k
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
455k
    } else {
512
455k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
455k
        ss->id = operator_id();
514
455k
        for (auto& dest : dests_id()) {
515
449k
            ss->related_op_ids.insert(dest);
516
449k
        }
517
455k
        return ss;
518
455k
    }
519
455k
}
_ZNK5doris17DataSinkOperatorXINS_33NestedLoopJoinBuildSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
5.80k
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.80k
    } else {
512
5.80k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
5.80k
        ss->id = operator_id();
514
5.80k
        for (auto& dest : dests_id()) {
515
5.80k
            ss->related_op_ids.insert(dest);
516
5.80k
        }
517
5.80k
        return ss;
518
5.80k
    }
519
5.80k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_19UnionSinkLocalStateEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33MultiCastDataStreamSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_27PartitionSortSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
535
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
535
    } else {
512
535
        auto ss = LocalStateType::SharedStateType::create_shared();
513
535
        ss->id = operator_id();
514
535
        for (auto& dest : dests_id()) {
515
535
            ss->related_op_ids.insert(dest);
516
535
        }
517
535
        return ss;
518
535
    }
519
535
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb1EEEE19create_shared_stateEv
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_22SetProbeSinkLocalStateILb0EEEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb1EEEE19create_shared_stateEv
Line
Count
Source
504
2.62k
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.62k
    } else {
512
2.62k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
2.62k
        ss->id = operator_id();
514
2.62k
        for (auto& dest : dests_id()) {
515
2.62k
            ss->related_op_ids.insert(dest);
516
2.62k
        }
517
2.62k
        return ss;
518
2.62k
    }
519
2.62k
}
_ZNK5doris17DataSinkOperatorXINS_17SetSinkLocalStateILb0EEEE19create_shared_stateEv
Line
Count
Source
504
2.46k
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.46k
    } else {
512
2.46k
        auto ss = LocalStateType::SharedStateType::create_shared();
513
2.46k
        ss->id = operator_id();
514
2.46k
        for (auto& dest : dests_id()) {
515
2.46k
            ss->related_op_ids.insert(dest);
516
2.46k
        }
517
2.46k
        return ss;
518
2.46k
    }
519
2.46k
}
Unexecuted instantiation: _ZNK5doris17DataSinkOperatorXINS_33PartitionedHashJoinSinkLocalStateEE19create_shared_stateEv
_ZNK5doris17DataSinkOperatorXINS_30GroupCommitBlockSinkLocalStateEE19create_shared_stateEv
Line
Count
Source
504
565
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
565
    } else {
512
565
        auto ss = LocalStateType::SharedStateType::create_shared();
513
565
        ss->id = operator_id();
514
565
        for (auto& dest : dests_id()) {
515
546
            ss->related_op_ids.insert(dest);
516
546
        }
517
565
        return ss;
518
565
    }
519
565
}
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
101
            ss->related_op_ids.insert(dest);
516
101
        }
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.90M
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.90M
    auto local_state = LocalStateType::create_unique(state, this);
524
1.90M
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.90M
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.90M
    return Status::OK();
527
1.90M
}
_ZN5doris9OperatorXINS_23HashJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
64.2k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
64.2k
    auto local_state = LocalStateType::create_unique(state, this);
524
64.2k
    RETURN_IF_ERROR(local_state->init(state, info));
525
64.2k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
64.2k
    return Status::OK();
527
64.2k
}
_ZN5doris9OperatorXINS_18OlapScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
230k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
230k
    auto local_state = LocalStateType::create_unique(state, this);
524
230k
    RETURN_IF_ERROR(local_state->init(state, info));
525
230k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
230k
    return Status::OK();
527
230k
}
_ZN5doris9OperatorXINS_21GroupCommitLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
114
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
114
    auto local_state = LocalStateType::create_unique(state, this);
524
114
    RETURN_IF_ERROR(local_state->init(state, info));
525
114
    state->emplace_local_state(operator_id(), std::move(local_state));
526
114
    return Status::OK();
527
114
}
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
11.8k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
11.8k
    auto local_state = LocalStateType::create_unique(state, this);
524
11.8k
    RETURN_IF_ERROR(local_state->init(state, info));
525
11.8k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
11.8k
    return Status::OK();
527
11.8k
}
_ZN5doris9OperatorXINS_14SortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
11.7k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
11.7k
    auto local_state = LocalStateType::create_unique(state, this);
524
11.7k
    RETURN_IF_ERROR(local_state->init(state, info));
525
11.7k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
11.7k
    return Status::OK();
527
11.7k
}
_ZN5doris9OperatorXINS_19SpillSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
25
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
25
    auto local_state = LocalStateType::create_unique(state, this);
524
25
    RETURN_IF_ERROR(local_state->init(state, info));
525
25
    state->emplace_local_state(operator_id(), std::move(local_state));
526
25
    return Status::OK();
527
25
}
_ZN5doris9OperatorXINS_24LocalMergeSortLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
173k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
173k
    auto local_state = LocalStateType::create_unique(state, this);
524
173k
    RETURN_IF_ERROR(local_state->init(state, info));
525
173k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
173k
    return Status::OK();
527
173k
}
_ZN5doris9OperatorXINS_13AggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
83.5k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
83.5k
    auto local_state = LocalStateType::create_unique(state, this);
524
83.5k
    RETURN_IF_ERROR(local_state->init(state, info));
525
83.5k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
83.5k
    return Status::OK();
527
83.5k
}
_ZN5doris9OperatorXINS_21BucketedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
86.0k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
86.0k
    auto local_state = LocalStateType::create_unique(state, this);
524
86.0k
    RETURN_IF_ERROR(local_state->init(state, info));
525
86.0k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
86.0k
    return Status::OK();
527
86.0k
}
_ZN5doris9OperatorXINS_24PartitionedAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
142
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
142
    auto local_state = LocalStateType::create_unique(state, this);
524
142
    RETURN_IF_ERROR(local_state->init(state, info));
525
142
    state->emplace_local_state(operator_id(), std::move(local_state));
526
142
    return Status::OK();
527
142
}
_ZN5doris9OperatorXINS_23TableFunctionLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
4.47k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
4.47k
    auto local_state = LocalStateType::create_unique(state, this);
524
4.47k
    RETURN_IF_ERROR(local_state->init(state, info));
525
4.47k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
4.47k
    return Status::OK();
527
4.47k
}
_ZN5doris9OperatorXINS_18ExchangeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
267k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
267k
    auto local_state = LocalStateType::create_unique(state, this);
524
267k
    RETURN_IF_ERROR(local_state->init(state, info));
525
267k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
267k
    return Status::OK();
527
267k
}
_ZN5doris9OperatorXINS_16RepeatLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
1.31k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.31k
    auto local_state = LocalStateType::create_unique(state, this);
524
1.31k
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.31k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.31k
    return Status::OK();
527
1.31k
}
_ZN5doris9OperatorXINS_29NestedLoopJoinProbeLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
5.78k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
5.78k
    auto local_state = LocalStateType::create_unique(state, this);
524
5.78k
    RETURN_IF_ERROR(local_state->init(state, info));
525
5.78k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
5.78k
    return Status::OK();
527
5.78k
}
_ZN5doris9OperatorXINS_23AssertNumRowsLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
21
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
21
    auto local_state = LocalStateType::create_unique(state, this);
524
21
    RETURN_IF_ERROR(local_state->init(state, info));
525
21
    state->emplace_local_state(operator_id(), std::move(local_state));
526
21
    return Status::OK();
527
21
}
_ZN5doris9OperatorXINS_18EmptySetLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
1.48k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.48k
    auto local_state = LocalStateType::create_unique(state, this);
524
1.48k
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.48k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.48k
    return Status::OK();
527
1.48k
}
_ZN5doris9OperatorXINS_21UnionSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
51.1k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
51.1k
    auto local_state = LocalStateType::create_unique(state, this);
524
51.1k
    RETURN_IF_ERROR(local_state->init(state, info));
525
51.1k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
51.1k
    return Status::OK();
527
51.1k
}
_ZN5doris9OperatorXINS_35MultiCastDataStreamSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
4.90k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
4.90k
    auto local_state = LocalStateType::create_unique(state, this);
524
4.90k
    RETURN_IF_ERROR(local_state->init(state, info));
525
4.90k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
4.90k
    return Status::OK();
527
4.90k
}
_ZN5doris9OperatorXINS_29PartitionSortSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
430
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
430
    auto local_state = LocalStateType::create_unique(state, this);
524
430
    RETURN_IF_ERROR(local_state->init(state, info));
525
430
    state->emplace_local_state(operator_id(), std::move(local_state));
526
430
    return Status::OK();
527
430
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb1EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
2.64k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.64k
    auto local_state = LocalStateType::create_unique(state, this);
524
2.64k
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.64k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.64k
    return Status::OK();
527
2.64k
}
_ZN5doris9OperatorXINS_19SetSourceLocalStateILb0EEEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
2.48k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
2.48k
    auto local_state = LocalStateType::create_unique(state, this);
524
2.48k
    RETURN_IF_ERROR(local_state->init(state, info));
525
2.48k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
2.48k
    return Status::OK();
527
2.48k
}
_ZN5doris9OperatorXINS_17DataGenLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
308
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
308
    auto local_state = LocalStateType::create_unique(state, this);
524
308
    RETURN_IF_ERROR(local_state->init(state, info));
525
308
    state->emplace_local_state(operator_id(), std::move(local_state));
526
308
    return Status::OK();
527
308
}
_ZN5doris9OperatorXINS_20SchemaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
1.56k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.56k
    auto local_state = LocalStateType::create_unique(state, this);
524
1.56k
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.56k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.56k
    return Status::OK();
527
1.56k
}
_ZN5doris9OperatorXINS_18MetaScanLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
4.38k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
4.38k
    auto local_state = LocalStateType::create_unique(state, this);
524
4.38k
    RETURN_IF_ERROR(local_state->init(state, info));
525
4.38k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
4.38k
    return Status::OK();
527
4.38k
}
_ZN5doris9OperatorXINS_29LocalExchangeSourceLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
589k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
589k
    auto local_state = LocalStateType::create_unique(state, this);
524
589k
    RETURN_IF_ERROR(local_state->init(state, info));
525
589k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
589k
    return Status::OK();
527
589k
}
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
780
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
780
    auto local_state = LocalStateType::create_unique(state, this);
524
780
    RETURN_IF_ERROR(local_state->init(state, info));
525
780
    state->emplace_local_state(operator_id(), std::move(local_state));
526
780
    return Status::OK();
527
780
}
_ZN5doris9OperatorXINS_16SelectLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
1.07k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
1.07k
    auto local_state = LocalStateType::create_unique(state, this);
524
1.07k
    RETURN_IF_ERROR(local_state->init(state, info));
525
1.07k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
1.07k
    return Status::OK();
527
1.07k
}
_ZN5doris9OperatorXINS_22StreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
4.57k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
4.57k
    auto local_state = LocalStateType::create_unique(state, this);
524
4.57k
    RETURN_IF_ERROR(local_state->init(state, info));
525
4.57k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
4.57k
    return Status::OK();
527
4.57k
}
_ZN5doris9OperatorXINS_30DistinctStreamingAggLocalStateEE17setup_local_stateEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
522
291k
Status OperatorX<LocalStateType>::setup_local_state(RuntimeState* state, LocalStateInfo& info) {
523
291k
    auto local_state = LocalStateType::create_unique(state, this);
524
291k
    RETURN_IF_ERROR(local_state->init(state, info));
525
291k
    state->emplace_local_state(operator_id(), std::move(local_state));
526
291k
    return Status::OK();
527
291k
}
528
529
PipelineXSinkLocalStateBase::PipelineXSinkLocalStateBase(DataSinkOperatorXBase* parent,
530
                                                         RuntimeState* state)
531
1.59M
        : _parent(parent), _state(state) {}
532
533
PipelineXLocalStateBase::PipelineXLocalStateBase(RuntimeState* state, OperatorXBase* parent)
534
1.89M
        : _num_rows_returned(0),
535
1.89M
          _rows_returned_counter(nullptr),
536
1.89M
          _parent(parent),
537
1.89M
          _state(state),
538
1.89M
          _budget(state->batch_size(), state->preferred_block_size_bytes()) {}
539
540
template <typename SharedStateArg>
541
1.90M
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
1.90M
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
1.90M
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
1.90M
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
1.90M
    _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.90M
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
1.90M
    _operator_profile->add_child(_common_profile.get(), true);
550
1.90M
    _operator_profile->add_child(_custom_profile.get(), true);
551
1.90M
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
1.90M
    if constexpr (!is_fake_shared) {
553
1.09M
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
688k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
688k
                                    .first.get()
556
688k
                                    ->template cast<SharedStateArg>();
557
558
688k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
688k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
688k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
688k
        } else if (info.shared_state) {
562
347k
            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
347k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
347k
            _dependency = _shared_state->create_source_dependency(
569
347k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
347k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
347k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
347k
        } else {
573
55.7k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
2.69k
                DCHECK(false);
575
2.69k
            }
576
55.7k
        }
577
1.09M
    }
578
579
1.90M
    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.90M
    _rows_returned_counter =
584
1.90M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
1.90M
    _blocks_returned_counter =
586
1.90M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
1.90M
    _output_block_bytes_counter =
588
1.90M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
1.90M
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
1.90M
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
1.90M
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
1.90M
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
1.90M
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
1.90M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
1.90M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
1.90M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
1.90M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
1.90M
    _memory_used_counter =
599
1.90M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
1.90M
    _common_profile->add_info_string("IsColocate",
601
1.90M
                                     std::to_string(_parent->is_colocated_operator()));
602
1.90M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
1.90M
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
1.90M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
1.90M
    return Status::OK();
606
1.90M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
64.4k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
64.4k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
64.4k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
64.4k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
64.4k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
64.4k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
64.4k
    _operator_profile->add_child(_common_profile.get(), true);
550
64.4k
    _operator_profile->add_child(_custom_profile.get(), true);
551
64.4k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
64.4k
    if constexpr (!is_fake_shared) {
553
64.4k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
13.4k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
13.4k
                                    .first.get()
556
13.4k
                                    ->template cast<SharedStateArg>();
557
558
13.4k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
13.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
13.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
51.0k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
50.4k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
50.4k
            _dependency = _shared_state->create_source_dependency(
569
50.4k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
50.4k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
50.4k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
50.4k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
512
        }
577
64.4k
    }
578
579
64.4k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
64.4k
    _rows_returned_counter =
584
64.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
64.4k
    _blocks_returned_counter =
586
64.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
64.4k
    _output_block_bytes_counter =
588
64.4k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
64.4k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
64.4k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
64.4k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
64.4k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
64.4k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
64.4k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
64.4k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
64.4k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
64.4k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
64.4k
    _memory_used_counter =
599
64.4k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
64.4k
    _common_profile->add_info_string("IsColocate",
601
64.4k
                                     std::to_string(_parent->is_colocated_operator()));
602
64.4k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
64.4k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
64.4k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
64.4k
    return Status::OK();
606
64.4k
}
_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
185k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
185k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
185k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
185k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
185k
    _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
185k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
185k
    _operator_profile->add_child(_common_profile.get(), true);
550
185k
    _operator_profile->add_child(_custom_profile.get(), true);
551
185k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
185k
    if constexpr (!is_fake_shared) {
553
185k
        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
185k
        } 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
182k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
182k
            _dependency = _shared_state->create_source_dependency(
569
182k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
182k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
182k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
182k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
3.35k
        }
577
185k
    }
578
579
185k
    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
185k
    _rows_returned_counter =
584
185k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
185k
    _blocks_returned_counter =
586
185k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
185k
    _output_block_bytes_counter =
588
185k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
185k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
185k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
185k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
185k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
185k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
185k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
185k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
185k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
185k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
185k
    _memory_used_counter =
599
185k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
185k
    _common_profile->add_info_string("IsColocate",
601
185k
                                     std::to_string(_parent->is_colocated_operator()));
602
185k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
185k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
185k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
185k
    return Status::OK();
606
185k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
25
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
25
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
25
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
25
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
25
    _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
25
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
25
    _operator_profile->add_child(_common_profile.get(), true);
550
25
    _operator_profile->add_child(_custom_profile.get(), true);
551
25
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
25
    if constexpr (!is_fake_shared) {
553
25
        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
25
        } 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
25
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
25
            _dependency = _shared_state->create_source_dependency(
569
25
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
25
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
25
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
25
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
25
    }
578
579
25
    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
25
    _rows_returned_counter =
584
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
25
    _blocks_returned_counter =
586
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
25
    _output_block_bytes_counter =
588
25
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
25
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
25
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
25
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
25
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
25
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
25
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
25
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
25
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
25
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
25
    _memory_used_counter =
599
25
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
25
    _common_profile->add_info_string("IsColocate",
601
25
                                     std::to_string(_parent->is_colocated_operator()));
602
25
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
25
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
25
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
25
    return Status::OK();
606
25
}
_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.77k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
5.77k
            _dependency = _shared_state->create_source_dependency(
569
5.77k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
5.77k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
5.77k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
5.77k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
22
        }
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
11.9k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
11.9k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
11.9k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
11.9k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
11.9k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
11.9k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
11.9k
    _operator_profile->add_child(_common_profile.get(), true);
550
11.9k
    _operator_profile->add_child(_custom_profile.get(), true);
551
11.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
11.9k
    if constexpr (!is_fake_shared) {
553
11.9k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
0
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
0
                                    .first.get()
556
0
                                    ->template cast<SharedStateArg>();
557
558
0
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
0
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
0
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
11.9k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
11.8k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
11.8k
            _dependency = _shared_state->create_source_dependency(
569
11.8k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
11.8k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
11.8k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
11.8k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
22
        }
577
11.9k
    }
578
579
11.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
11.9k
    _rows_returned_counter =
584
11.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
11.9k
    _blocks_returned_counter =
586
11.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
11.9k
    _output_block_bytes_counter =
588
11.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
11.9k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
11.9k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
11.9k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
11.9k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
11.9k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
11.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
11.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
11.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
11.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
11.9k
    _memory_used_counter =
599
11.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
11.9k
    _common_profile->add_info_string("IsColocate",
601
11.9k
                                     std::to_string(_parent->is_colocated_operator()));
602
11.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
11.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
11.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
11.9k
    return Status::OK();
606
11.9k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
83.6k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
83.6k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
83.6k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
83.6k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
83.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
83.6k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
83.6k
    _operator_profile->add_child(_common_profile.get(), true);
550
83.6k
    _operator_profile->add_child(_custom_profile.get(), true);
551
83.6k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
83.6k
    if constexpr (!is_fake_shared) {
553
83.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
83.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
82.9k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
82.9k
            _dependency = _shared_state->create_source_dependency(
569
82.9k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
82.9k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
82.9k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
82.9k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
721
        }
577
83.6k
    }
578
579
83.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
83.6k
    _rows_returned_counter =
584
83.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
83.6k
    _blocks_returned_counter =
586
83.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
83.6k
    _output_block_bytes_counter =
588
83.6k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
83.6k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
83.6k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
83.6k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
83.6k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
83.6k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
83.6k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
83.6k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
83.6k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
83.6k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
83.6k
    _memory_used_counter =
599
83.6k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
83.6k
    _common_profile->add_info_string("IsColocate",
601
83.6k
                                     std::to_string(_parent->is_colocated_operator()));
602
83.6k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
83.6k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
83.6k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
83.6k
    return Status::OK();
606
83.6k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
86.0k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
86.0k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
86.0k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
86.0k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
86.0k
    _operator_profile->set_metadata(_parent->node_id());
546
    // indent is false so that source operator will have same
547
    // indentation_level with its parent operator.
548
86.0k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
86.0k
    _operator_profile->add_child(_common_profile.get(), true);
550
86.0k
    _operator_profile->add_child(_custom_profile.get(), true);
551
86.0k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
86.0k
    if constexpr (!is_fake_shared) {
553
86.1k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
86.1k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
86.1k
                                    .first.get()
556
86.1k
                                    ->template cast<SharedStateArg>();
557
558
86.1k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
86.1k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
86.1k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
18.4E
        } 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
18.4E
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
18.4E
        }
577
86.0k
    }
578
579
86.0k
    if (must_set_shared_state() && _shared_state == nullptr) {
580
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
581
0
    }
582
583
86.0k
    _rows_returned_counter =
584
86.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
86.0k
    _blocks_returned_counter =
586
86.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
86.0k
    _output_block_bytes_counter =
588
86.0k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
86.0k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
86.0k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
86.0k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
86.0k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
86.0k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
86.0k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
86.0k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
86.0k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
86.0k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
86.0k
    _memory_used_counter =
599
86.0k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
86.0k
    _common_profile->add_info_string("IsColocate",
601
86.0k
                                     std::to_string(_parent->is_colocated_operator()));
602
86.0k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
86.0k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
86.0k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
86.0k
    return Status::OK();
606
86.0k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
142
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
142
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
142
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
142
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
142
    _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
142
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
142
    _operator_profile->add_child(_common_profile.get(), true);
550
142
    _operator_profile->add_child(_custom_profile.get(), true);
551
142
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
142
    if constexpr (!is_fake_shared) {
553
142
        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
142
        } 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
142
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
142
            _dependency = _shared_state->create_source_dependency(
569
142
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
142
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
142
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
142
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
0
        }
577
142
    }
578
579
142
    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
142
    _rows_returned_counter =
584
142
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
142
    _blocks_returned_counter =
586
142
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
142
    _output_block_bytes_counter =
588
142
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
142
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
142
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
142
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
142
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
142
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
142
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
142
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
142
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
142
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
142
    _memory_used_counter =
599
142
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
142
    _common_profile->add_info_string("IsColocate",
601
142
                                     std::to_string(_parent->is_colocated_operator()));
602
142
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
142
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
142
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
142
    return Status::OK();
606
142
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
812k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
812k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
812k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
812k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
812k
    _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
812k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
812k
    _operator_profile->add_child(_common_profile.get(), true);
550
812k
    _operator_profile->add_child(_custom_profile.get(), true);
551
812k
    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
812k
    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
812k
    _rows_returned_counter =
584
812k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
812k
    _blocks_returned_counter =
586
812k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
812k
    _output_block_bytes_counter =
588
812k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
812k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
812k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
812k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
812k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
812k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
812k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
812k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
812k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
812k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
812k
    _memory_used_counter =
599
812k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
812k
    _common_profile->add_info_string("IsColocate",
601
812k
                                     std::to_string(_parent->is_colocated_operator()));
602
812k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
812k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
812k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
812k
    return Status::OK();
606
812k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
51.1k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
51.1k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
51.1k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
51.1k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
51.1k
    _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
51.1k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
51.1k
    _operator_profile->add_child(_common_profile.get(), true);
550
51.1k
    _operator_profile->add_child(_custom_profile.get(), true);
551
51.1k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
51.1k
    if constexpr (!is_fake_shared) {
553
51.1k
        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
51.1k
        } else if (info.shared_state) {
562
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
563
                DCHECK(false);
564
            }
565
            // For UnionSourceOperator without children, there is no shared state.
566
2.62k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
2.62k
            _dependency = _shared_state->create_source_dependency(
569
2.62k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
2.62k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
2.62k
                    _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
51.1k
    }
578
579
51.1k
    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
51.1k
    _rows_returned_counter =
584
51.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
51.1k
    _blocks_returned_counter =
586
51.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
51.1k
    _output_block_bytes_counter =
588
51.1k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
51.1k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
51.1k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
51.1k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
51.1k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
51.1k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
51.1k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
51.1k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
51.1k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
51.1k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
51.1k
    _memory_used_counter =
599
51.1k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
51.1k
    _common_profile->add_info_string("IsColocate",
601
51.1k
                                     std::to_string(_parent->is_colocated_operator()));
602
51.1k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
51.1k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
51.1k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
51.1k
    return Status::OK();
606
51.1k
}
_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.90k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
4.90k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
4.90k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
4.90k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
4.90k
    _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.90k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
4.90k
    _operator_profile->add_child(_common_profile.get(), true);
550
4.90k
    _operator_profile->add_child(_custom_profile.get(), true);
551
4.90k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
4.90k
    if constexpr (!is_fake_shared) {
553
4.90k
        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.90k
        } 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.89k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
4.89k
            _dependency = _shared_state->create_source_dependency(
569
4.89k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
4.89k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
4.89k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
4.89k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
6
        }
577
4.90k
    }
578
579
4.90k
    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.90k
    _rows_returned_counter =
584
4.90k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
4.90k
    _blocks_returned_counter =
586
4.90k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
4.90k
    _output_block_bytes_counter =
588
4.90k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
4.90k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
4.90k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
4.90k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
4.90k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
4.90k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
4.90k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
4.90k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
4.90k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
4.90k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
4.90k
    _memory_used_counter =
599
4.90k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
4.90k
    _common_profile->add_info_string("IsColocate",
601
4.90k
                                     std::to_string(_parent->is_colocated_operator()));
602
4.90k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
4.90k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
4.90k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
4.90k
    return Status::OK();
606
4.90k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
532
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
532
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
532
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
532
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
532
    _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
532
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
532
    _operator_profile->add_child(_common_profile.get(), true);
550
532
    _operator_profile->add_child(_custom_profile.get(), true);
551
532
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
532
    if constexpr (!is_fake_shared) {
553
532
        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
532
        } 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
2
        }
577
532
    }
578
579
532
    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
532
    _rows_returned_counter =
584
532
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
532
    _blocks_returned_counter =
586
532
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
532
    _output_block_bytes_counter =
588
532
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
532
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
532
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
532
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
532
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
532
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
532
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
532
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
532
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
532
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
532
    _memory_used_counter =
599
532
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
532
    _common_profile->add_info_string("IsColocate",
601
532
                                     std::to_string(_parent->is_colocated_operator()));
602
532
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
532
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
532
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
532
    return Status::OK();
606
532
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
5.15k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
5.15k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
5.15k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
5.15k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
5.15k
    _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.15k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
5.15k
    _operator_profile->add_child(_common_profile.get(), true);
550
5.15k
    _operator_profile->add_child(_custom_profile.get(), true);
551
5.15k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
5.15k
    if constexpr (!is_fake_shared) {
553
5.15k
        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.15k
        } 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.09k
            _shared_state = info.shared_state->template cast<SharedStateArg>();
567
568
5.09k
            _dependency = _shared_state->create_source_dependency(
569
5.09k
                    _parent->operator_id(), _parent->node_id(), _parent->get_name());
570
5.09k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
571
5.09k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
572
5.09k
        } else {
573
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
                DCHECK(false);
575
            }
576
54
        }
577
5.15k
    }
578
579
5.15k
    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.15k
    _rows_returned_counter =
584
5.15k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
5.15k
    _blocks_returned_counter =
586
5.15k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
5.15k
    _output_block_bytes_counter =
588
5.15k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
5.15k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
5.15k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
5.15k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
5.15k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
5.15k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
5.15k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
5.15k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
5.15k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
5.15k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
5.15k
    _memory_used_counter =
599
5.15k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
5.15k
    _common_profile->add_info_string("IsColocate",
601
5.15k
                                     std::to_string(_parent->is_colocated_operator()));
602
5.15k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
5.15k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
5.15k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
5.15k
    return Status::OK();
606
5.15k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4initEPNS_12RuntimeStateERNS_14LocalStateInfoE
Line
Count
Source
541
591k
Status PipelineXLocalState<SharedStateArg>::init(RuntimeState* state, LocalStateInfo& info) {
542
591k
    _operator_profile.reset(new RuntimeProfile(_parent->get_name() + name_suffix()));
543
591k
    _common_profile.reset(new RuntimeProfile(profile::COMMON_COUNTERS));
544
591k
    _custom_profile.reset(new RuntimeProfile(profile::CUSTOM_COUNTERS));
545
591k
    _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
591k
    info.parent_profile->add_child(_operator_profile.get(), /*indent=*/false);
549
591k
    _operator_profile->add_child(_common_profile.get(), true);
550
591k
    _operator_profile->add_child(_custom_profile.get(), true);
551
591k
    constexpr auto is_fake_shared = std::is_same_v<SharedStateArg, FakeSharedState>;
552
591k
    if constexpr (!is_fake_shared) {
553
591k
        if (info.shared_state_map.find(_parent->operator_id()) != info.shared_state_map.end()) {
554
588k
            _shared_state = info.shared_state_map.at(_parent->operator_id())
555
588k
                                    .first.get()
556
588k
                                    ->template cast<SharedStateArg>();
557
558
588k
            _dependency = _shared_state->get_dep_by_channel_id(info.task_idx).front().get();
559
588k
            _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
560
588k
                    _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
561
588k
        } 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
2.69k
        } else {
573
2.69k
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedStateArg>) {
574
2.69k
                DCHECK(false);
575
2.69k
            }
576
2.69k
        }
577
591k
    }
578
579
591k
    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
591k
    _rows_returned_counter =
584
591k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::ROWS_PRODUCED, TUnit::UNIT, 1);
585
591k
    _blocks_returned_counter =
586
591k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::BLOCKS_PRODUCED, TUnit::UNIT, 1);
587
591k
    _output_block_bytes_counter =
588
591k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
589
591k
    _max_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
590
591k
            _common_profile, profile::MAX_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
591
591k
    _min_output_block_bytes_counter = ADD_COUNTER_WITH_LEVEL(
592
591k
            _common_profile, profile::MIN_OUTPUT_BLOCK_BYTES, TUnit::BYTES, 1);
593
591k
    _projection_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::PROJECTION_TIME, 2);
594
591k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
595
591k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
596
591k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
597
591k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
598
591k
    _memory_used_counter =
599
591k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
600
591k
    _common_profile->add_info_string("IsColocate",
601
591k
                                     std::to_string(_parent->is_colocated_operator()));
602
591k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
603
591k
    _common_profile->add_info_string("FollowedByShuffledOperator",
604
591k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
605
591k
    return Status::OK();
606
591k
}
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.91M
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
1.91M
    _conjuncts.resize(_parent->_conjuncts.size());
611
1.91M
    _projections.resize(_parent->_projections.size());
612
2.19M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
284k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
284k
    }
615
3.70M
    for (size_t i = 0; i < _projections.size(); i++) {
616
1.79M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
1.79M
    }
618
1.91M
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
1.91M
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
5.73k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
35.4k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
29.7k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
29.7k
                    state, _intermediate_projections[i][j]));
624
29.7k
        }
625
5.73k
    }
626
1.91M
    return Status::OK();
627
1.91M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
64.5k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
64.5k
    _conjuncts.resize(_parent->_conjuncts.size());
611
64.5k
    _projections.resize(_parent->_projections.size());
612
65.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
721
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
721
    }
615
328k
    for (size_t i = 0; i < _projections.size(); i++) {
616
264k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
264k
    }
618
64.5k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
65.3k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
759
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
5.85k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
5.09k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
5.09k
                    state, _intermediate_projections[i][j]));
624
5.09k
        }
625
759
    }
626
64.5k
    return Status::OK();
627
64.5k
}
_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
186k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
186k
    _conjuncts.resize(_parent->_conjuncts.size());
611
186k
    _projections.resize(_parent->_projections.size());
612
186k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
187k
    for (size_t i = 0; i < _projections.size(); i++) {
616
299
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
299
    }
618
186k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
186k
    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
186k
    return Status::OK();
627
186k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE4openEPNS_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_25NestedLoopJoinSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
5.80k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
5.80k
    _conjuncts.resize(_parent->_conjuncts.size());
611
5.80k
    _projections.resize(_parent->_projections.size());
612
5.85k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
57
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
57
    }
615
27.1k
    for (size_t i = 0; i < _projections.size(); i++) {
616
21.3k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
21.3k
    }
618
5.80k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
5.80k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
6
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
45
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
39
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
39
                    state, _intermediate_projections[i][j]));
624
39
        }
625
6
    }
626
5.80k
    return Status::OK();
627
5.80k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
11.9k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
11.9k
    _conjuncts.resize(_parent->_conjuncts.size());
611
11.9k
    _projections.resize(_parent->_projections.size());
612
12.8k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
940
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
940
    }
615
32.3k
    for (size_t i = 0; i < _projections.size(); i++) {
616
20.4k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
20.4k
    }
618
11.9k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
12.0k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
93
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
710
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
617
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
617
                    state, _intermediate_projections[i][j]));
624
617
        }
625
93
    }
626
11.9k
    return Status::OK();
627
11.9k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
83.9k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
83.9k
    _conjuncts.resize(_parent->_conjuncts.size());
611
83.9k
    _projections.resize(_parent->_projections.size());
612
85.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
1.23k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
1.23k
    }
615
294k
    for (size_t i = 0; i < _projections.size(); i++) {
616
210k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
210k
    }
618
83.9k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
84.1k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
129
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
829
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
700
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
700
                    state, _intermediate_projections[i][j]));
624
700
        }
625
129
    }
626
83.9k
    return Status::OK();
627
83.9k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
86.1k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
86.1k
    _conjuncts.resize(_parent->_conjuncts.size());
611
86.1k
    _projections.resize(_parent->_projections.size());
612
86.2k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
42
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
42
    }
615
87.0k
    for (size_t i = 0; i < _projections.size(); i++) {
616
877
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
877
    }
618
86.1k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
86.1k
    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
86.1k
    return Status::OK();
627
86.1k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
146
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
146
    _conjuncts.resize(_parent->_conjuncts.size());
611
146
    _projections.resize(_parent->_projections.size());
612
146
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
402
    for (size_t i = 0; i < _projections.size(); i++) {
616
256
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
256
    }
618
146
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
146
    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
146
    return Status::OK();
627
146
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
817k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
817k
    _conjuncts.resize(_parent->_conjuncts.size());
611
817k
    _projections.resize(_parent->_projections.size());
612
1.09M
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
280k
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
280k
    }
615
2.00M
    for (size_t i = 0; i < _projections.size(); i++) {
616
1.18M
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
1.18M
    }
618
817k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
821k
    for (int i = 0; i < _parent->_intermediate_projections.size(); i++) {
620
4.74k
        _intermediate_projections[i].resize(_parent->_intermediate_projections[i].size());
621
28.0k
        for (int j = 0; j < _parent->_intermediate_projections[i].size(); j++) {
622
23.2k
            RETURN_IF_ERROR(_parent->_intermediate_projections[i][j]->clone(
623
23.2k
                    state, _intermediate_projections[i][j]));
624
23.2k
        }
625
4.74k
    }
626
817k
    return Status::OK();
627
817k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
51.3k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
51.3k
    _conjuncts.resize(_parent->_conjuncts.size());
611
51.3k
    _projections.resize(_parent->_projections.size());
612
51.3k
    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.2k
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
85.2k
    }
618
51.3k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
51.3k
    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.3k
    return Status::OK();
627
51.3k
}
_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.89k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
4.89k
    _conjuncts.resize(_parent->_conjuncts.size());
611
4.89k
    _projections.resize(_parent->_projections.size());
612
5.69k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
804
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
804
    }
615
4.89k
    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.89k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
4.89k
    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.89k
    return Status::OK();
627
4.89k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
535
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
535
    _conjuncts.resize(_parent->_conjuncts.size());
611
535
    _projections.resize(_parent->_projections.size());
612
535
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
535
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
535
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
535
    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
535
    return Status::OK();
627
535
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
5.15k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
5.15k
    _conjuncts.resize(_parent->_conjuncts.size());
611
5.15k
    _projections.resize(_parent->_projections.size());
612
5.15k
    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.32k
    for (size_t i = 0; i < _projections.size(); i++) {
616
167
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
167
    }
618
5.15k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
5.15k
    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.15k
    return Status::OK();
627
5.15k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE4openEPNS_12RuntimeStateE
Line
Count
Source
609
594k
Status PipelineXLocalState<SharedStateArg>::open(RuntimeState* state) {
610
594k
    _conjuncts.resize(_parent->_conjuncts.size());
611
594k
    _projections.resize(_parent->_projections.size());
612
594k
    for (size_t i = 0; i < _conjuncts.size(); i++) {
613
0
        RETURN_IF_ERROR(_parent->_conjuncts[i]->clone(state, _conjuncts[i]));
614
0
    }
615
594k
    for (size_t i = 0; i < _projections.size(); i++) {
616
0
        RETURN_IF_ERROR(_parent->_projections[i]->clone(state, _projections[i]));
617
0
    }
618
594k
    _intermediate_projections.resize(_parent->_intermediate_projections.size());
619
594k
    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
594k
    return Status::OK();
627
594k
}
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
6.90k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
6.90k
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
6.90k
    _terminated = true;
635
6.90k
    return Status::OK();
636
6.90k
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
445
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
445
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
445
    _terminated = true;
635
445
    return Status::OK();
636
445
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_30PartitionedHashJoinSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15SortSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
23
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
23
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
23
    _terminated = true;
635
23
    return Status::OK();
636
23
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
62
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
62
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
62
    _terminated = true;
635
62
    return Status::OK();
636
62
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
68
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
68
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
68
    _terminated = true;
635
68
    return Status::OK();
636
68
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
1
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
1
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
1
    _terminated = true;
635
1
    return Status::OK();
636
1
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
5.31k
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
5.31k
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
5.31k
    _terminated = true;
635
5.31k
    return Status::OK();
636
5.31k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE9terminateEPNS_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
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE9terminateEPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
3
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
3
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
3
    _terminated = true;
635
3
    return Status::OK();
636
3
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
928
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
928
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
928
    _terminated = true;
635
928
    return Status::OK();
636
928
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE9terminateEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE9terminateEPNS_12RuntimeStateE
Line
Count
Source
630
34
Status PipelineXLocalState<SharedStateArg>::terminate(RuntimeState* state) {
631
34
    if (_terminated) {
632
0
        return Status::OK();
633
0
    }
634
34
    _terminated = true;
635
34
    return Status::OK();
636
34
}
637
638
template <typename SharedStateArg>
639
2.13M
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
2.13M
    if (_closed) {
641
219k
        return Status::OK();
642
219k
    }
643
1.91M
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
1.09M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
1.09M
    }
646
1.91M
    _closed = true;
647
1.91M
    return Status::OK();
648
2.13M
}
_ZN5doris19PipelineXLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
64.5k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
64.5k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
64.5k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
64.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
64.5k
    }
646
64.5k
    _closed = true;
647
64.5k
    return Status::OK();
648
64.5k
}
_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
371k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
371k
    if (_closed) {
641
185k
        return Status::OK();
642
185k
    }
643
185k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
185k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
185k
    }
646
185k
    _closed = true;
647
185k
    return Status::OK();
648
371k
}
_ZN5doris19PipelineXLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
25
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
25
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
25
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
25
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
25
    }
646
25
    _closed = true;
647
25
    return Status::OK();
648
25
}
_ZN5doris19PipelineXLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
5.80k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
5.80k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
5.80k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
5.80k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
5.80k
    }
646
5.80k
    _closed = true;
647
5.80k
    return Status::OK();
648
5.80k
}
_ZN5doris19PipelineXLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
23.9k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
23.9k
    if (_closed) {
641
12.0k
        return Status::OK();
642
12.0k
    }
643
11.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
11.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
11.8k
    }
646
11.8k
    _closed = true;
647
11.8k
    return Status::OK();
648
23.9k
}
_ZN5doris19PipelineXLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
83.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
83.7k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
83.7k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
83.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
83.7k
    }
646
83.7k
    _closed = true;
647
83.7k
    return Status::OK();
648
83.7k
}
_ZN5doris19PipelineXLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
85.8k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
85.8k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
85.8k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
85.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
85.8k
    }
646
85.8k
    _closed = true;
647
85.8k
    return Status::OK();
648
85.8k
}
_ZN5doris19PipelineXLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
141
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
141
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
141
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
141
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
141
    }
646
141
    _closed = true;
647
141
    return Status::OK();
648
141
}
_ZN5doris19PipelineXLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
833k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
833k
    if (_closed) {
641
15.5k
        return Status::OK();
642
15.5k
    }
643
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
    }
646
817k
    _closed = true;
647
817k
    return Status::OK();
648
833k
}
_ZN5doris19PipelineXLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
51.3k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
51.3k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
51.3k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
51.3k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
51.3k
    }
646
51.3k
    _closed = true;
647
51.3k
    return Status::OK();
648
51.3k
}
_ZN5doris19PipelineXLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
28
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
28
    if (_closed) {
641
14
        return Status::OK();
642
14
    }
643
14
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
14
    }
646
14
    _closed = true;
647
14
    return Status::OK();
648
28
}
_ZN5doris19PipelineXLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
4.86k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
4.86k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
4.86k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
4.86k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
4.86k
    }
646
4.86k
    _closed = true;
647
4.86k
    return Status::OK();
648
4.86k
}
_ZN5doris19PipelineXLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
864
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
864
    if (_closed) {
641
433
        return Status::OK();
642
433
    }
643
431
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
431
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
431
    }
646
431
    _closed = true;
647
431
    return Status::OK();
648
864
}
_ZN5doris19PipelineXLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
10.7k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
10.7k
    if (_closed) {
641
5.62k
        return Status::OK();
642
5.62k
    }
643
5.14k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
5.14k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
5.14k
    }
646
5.14k
    _closed = true;
647
5.14k
    return Status::OK();
648
10.7k
}
_ZN5doris19PipelineXLocalStateINS_24LocalExchangeSharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
595k
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
595k
    if (_closed) {
641
0
        return Status::OK();
642
0
    }
643
595k
    if constexpr (!std::is_same_v<SharedStateArg, FakeSharedState>) {
644
595k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
645
595k
    }
646
595k
    _closed = true;
647
595k
    return Status::OK();
648
595k
}
Unexecuted instantiation: _ZN5doris19PipelineXLocalStateINS_16BasicSharedStateEE5closeEPNS_12RuntimeStateE
_ZN5doris19PipelineXLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateE
Line
Count
Source
639
325
Status PipelineXLocalState<SharedStateArg>::close(RuntimeState* state) {
640
325
    if (_closed) {
641
170
        return Status::OK();
642
170
    }
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
325
}
649
650
template <typename SharedState>
651
1.60M
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
1.60M
    _operator_profile =
654
1.60M
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
1.60M
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
1.60M
    _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.60M
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
1.60M
    _operator_profile->add_child(_common_profile, true);
663
1.60M
    _operator_profile->add_child(_custom_profile, true);
664
665
1.60M
    _operator_profile->set_metadata(_parent->node_id());
666
1.60M
    _wait_for_finish_dependency_timer =
667
1.60M
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
1.60M
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
1.60M
    if constexpr (!is_fake_shared) {
670
1.14M
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
1.14M
            info.shared_state_map.end()) {
672
324k
            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
324k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
324k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
324k
                                                  ? 0
678
324k
                                                  : info.task_idx]
679
324k
                                  .get();
680
324k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
822k
        } else {
682
18.4E
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
18.4E
                DCHECK(false);
684
18.4E
            }
685
822k
            _shared_state = info.shared_state->template cast<SharedState>();
686
822k
            _dependency = _shared_state->create_sink_dependency(
687
822k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
822k
        }
689
1.14M
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
1.14M
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
1.14M
    }
692
693
1.60M
    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.60M
    _rows_input_counter =
698
1.60M
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
1.60M
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
1.60M
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
1.60M
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
1.60M
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
1.60M
    _memory_used_counter =
704
1.60M
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
1.60M
    _common_profile->add_info_string("IsColocate",
706
1.60M
                                     std::to_string(_parent->is_colocated_operator()));
707
1.60M
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
1.60M
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
1.60M
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
1.60M
    return Status::OK();
711
1.60M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
112k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
112k
    _operator_profile =
654
112k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
112k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
112k
    _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
112k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
112k
    _operator_profile->add_child(_common_profile, true);
663
112k
    _operator_profile->add_child(_custom_profile, true);
664
665
112k
    _operator_profile->set_metadata(_parent->node_id());
666
112k
    _wait_for_finish_dependency_timer =
667
112k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
112k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
112k
    if constexpr (!is_fake_shared) {
670
112k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
112k
            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
13.6k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
13.6k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
13.6k
                                                  ? 0
678
13.6k
                                                  : info.task_idx]
679
13.6k
                                  .get();
680
13.6k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
98.7k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
98.7k
            _shared_state = info.shared_state->template cast<SharedState>();
686
98.7k
            _dependency = _shared_state->create_sink_dependency(
687
98.7k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
98.7k
        }
689
112k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
112k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
112k
    }
692
693
112k
    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
112k
    _rows_input_counter =
698
112k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
112k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
112k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
112k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
112k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
112k
    _memory_used_counter =
704
112k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
112k
    _common_profile->add_info_string("IsColocate",
706
112k
                                     std::to_string(_parent->is_colocated_operator()));
707
112k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
112k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
112k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
112k
    return Status::OK();
711
112k
}
_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
185k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
185k
    _operator_profile =
654
185k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
185k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
185k
    _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
185k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
185k
    _operator_profile->add_child(_common_profile, true);
663
185k
    _operator_profile->add_child(_custom_profile, true);
664
665
185k
    _operator_profile->set_metadata(_parent->node_id());
666
185k
    _wait_for_finish_dependency_timer =
667
185k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
185k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
185k
    if constexpr (!is_fake_shared) {
670
185k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
185k
            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
185k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
185k
            _shared_state = info.shared_state->template cast<SharedState>();
686
185k
            _dependency = _shared_state->create_sink_dependency(
687
185k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
185k
        }
689
185k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
185k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
185k
    }
692
693
185k
    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
185k
    _rows_input_counter =
698
185k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
185k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
185k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
185k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
185k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
185k
    _memory_used_counter =
704
185k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
185k
    _common_profile->add_info_string("IsColocate",
706
185k
                                     std::to_string(_parent->is_colocated_operator()));
707
185k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
185k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
185k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
185k
    return Status::OK();
711
185k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
32
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
32
    _operator_profile =
654
32
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
32
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
32
    _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
32
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
32
    _operator_profile->add_child(_common_profile, true);
663
32
    _operator_profile->add_child(_custom_profile, true);
664
665
32
    _operator_profile->set_metadata(_parent->node_id());
666
32
    _wait_for_finish_dependency_timer =
667
32
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
32
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
32
    if constexpr (!is_fake_shared) {
670
32
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
32
            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
32
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
32
            _shared_state = info.shared_state->template cast<SharedState>();
686
32
            _dependency = _shared_state->create_sink_dependency(
687
32
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
32
        }
689
32
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
32
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
32
    }
692
693
32
    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
32
    _rows_input_counter =
698
32
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
32
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
32
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
32
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
32
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
32
    _memory_used_counter =
704
32
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
32
    _common_profile->add_info_string("IsColocate",
706
32
                                     std::to_string(_parent->is_colocated_operator()));
707
32
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
32
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
32
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
32
    return Status::OK();
711
32
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
5.80k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
5.80k
    _operator_profile =
654
5.80k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
5.80k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
5.80k
    _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.80k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
5.80k
    _operator_profile->add_child(_common_profile, true);
663
5.80k
    _operator_profile->add_child(_custom_profile, true);
664
665
5.80k
    _operator_profile->set_metadata(_parent->node_id());
666
5.80k
    _wait_for_finish_dependency_timer =
667
5.80k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
5.80k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
5.80k
    if constexpr (!is_fake_shared) {
670
5.80k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
5.80k
            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.80k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
5.80k
            _shared_state = info.shared_state->template cast<SharedState>();
686
5.80k
            _dependency = _shared_state->create_sink_dependency(
687
5.80k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
5.80k
        }
689
5.80k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
5.80k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
5.80k
    }
692
693
5.80k
    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.80k
    _rows_input_counter =
698
5.80k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
5.80k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
5.80k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
5.80k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
5.80k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
5.80k
    _memory_used_counter =
704
5.80k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
5.80k
    _common_profile->add_info_string("IsColocate",
706
5.80k
                                     std::to_string(_parent->is_colocated_operator()));
707
5.80k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
5.80k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
5.80k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
5.80k
    return Status::OK();
711
5.80k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
11.9k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
11.9k
    _operator_profile =
654
11.9k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
11.9k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
11.9k
    _custom_profile = state->obj_pool()->add(new RuntimeProfile(profile::CUSTOM_COUNTERS));
657
658
    // indentation is true
659
    // The parent profile of sink operator is usually a RuntimeProfile called PipelineTask.
660
    // So we should set the indentation to true.
661
11.9k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
11.9k
    _operator_profile->add_child(_common_profile, true);
663
11.9k
    _operator_profile->add_child(_custom_profile, true);
664
665
11.9k
    _operator_profile->set_metadata(_parent->node_id());
666
11.9k
    _wait_for_finish_dependency_timer =
667
11.9k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
11.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
11.9k
    if constexpr (!is_fake_shared) {
670
11.9k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
11.9k
            info.shared_state_map.end()) {
672
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
673
                DCHECK(info.shared_state_map.at(_parent->dests_id().front()).second.size() == 1);
674
            }
675
0
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
0
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
0
                                                  ? 0
678
0
                                                  : info.task_idx]
679
0
                                  .get();
680
0
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
11.9k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
11.9k
            _shared_state = info.shared_state->template cast<SharedState>();
686
11.9k
            _dependency = _shared_state->create_sink_dependency(
687
11.9k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
11.9k
        }
689
11.9k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
11.9k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
11.9k
    }
692
693
11.9k
    if (must_set_shared_state() && _shared_state == nullptr) {
694
0
        return Status::InternalError("must set shared state, in {}", _parent->get_name());
695
0
    }
696
697
11.9k
    _rows_input_counter =
698
11.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
11.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
11.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
11.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
11.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
11.9k
    _memory_used_counter =
704
11.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
11.9k
    _common_profile->add_info_string("IsColocate",
706
11.9k
                                     std::to_string(_parent->is_colocated_operator()));
707
11.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
11.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
11.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
11.9k
    return Status::OK();
711
11.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
83.7k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
83.7k
    _operator_profile =
654
83.7k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
83.7k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
83.7k
    _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
83.7k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
83.7k
    _operator_profile->add_child(_common_profile, true);
663
83.7k
    _operator_profile->add_child(_custom_profile, true);
664
665
83.7k
    _operator_profile->set_metadata(_parent->node_id());
666
83.7k
    _wait_for_finish_dependency_timer =
667
83.7k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
83.7k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
83.7k
    if constexpr (!is_fake_shared) {
670
83.7k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
83.7k
            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
83.7k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
83.7k
            _shared_state = info.shared_state->template cast<SharedState>();
686
83.7k
            _dependency = _shared_state->create_sink_dependency(
687
83.7k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
83.7k
        }
689
83.7k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
83.7k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
83.7k
    }
692
693
83.7k
    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
83.7k
    _rows_input_counter =
698
83.7k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
83.7k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
83.7k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
83.7k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
83.7k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
83.7k
    _memory_used_counter =
704
83.7k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
83.7k
    _common_profile->add_info_string("IsColocate",
706
83.7k
                                     std::to_string(_parent->is_colocated_operator()));
707
83.7k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
83.7k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
83.7k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
83.7k
    return Status::OK();
711
83.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
85.9k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
85.9k
    _operator_profile =
654
85.9k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
85.9k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
85.9k
    _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.9k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
85.9k
    _operator_profile->add_child(_common_profile, true);
663
85.9k
    _operator_profile->add_child(_custom_profile, true);
664
665
85.9k
    _operator_profile->set_metadata(_parent->node_id());
666
85.9k
    _wait_for_finish_dependency_timer =
667
85.9k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
85.9k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
85.9k
    if constexpr (!is_fake_shared) {
670
85.9k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
86.1k
            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
86.1k
            _dependency = info.shared_state_map.at(_parent->dests_id().front())
676
86.1k
                                  .second[std::is_same_v<LocalExchangeSharedState, SharedState>
677
86.1k
                                                  ? 0
678
86.1k
                                                  : info.task_idx]
679
86.1k
                                  .get();
680
86.1k
            _shared_state = _dependency->shared_state()->template cast<SharedState>();
681
18.4E
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
18.4E
            _shared_state = info.shared_state->template cast<SharedState>();
686
18.4E
            _dependency = _shared_state->create_sink_dependency(
687
18.4E
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
18.4E
        }
689
85.9k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
85.9k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
85.9k
    }
692
693
85.9k
    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.9k
    _rows_input_counter =
698
85.9k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
85.9k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
85.9k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
85.9k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
85.9k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
85.9k
    _memory_used_counter =
704
85.9k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
85.9k
    _common_profile->add_info_string("IsColocate",
706
85.9k
                                     std::to_string(_parent->is_colocated_operator()));
707
85.9k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
85.9k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
85.9k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
85.9k
    return Status::OK();
711
85.9k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
152
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
152
    _operator_profile =
654
152
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
152
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
152
    _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
152
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
152
    _operator_profile->add_child(_common_profile, true);
663
152
    _operator_profile->add_child(_custom_profile, true);
664
665
152
    _operator_profile->set_metadata(_parent->node_id());
666
152
    _wait_for_finish_dependency_timer =
667
152
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
152
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
152
    if constexpr (!is_fake_shared) {
670
152
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
152
            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
152
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
152
            _shared_state = info.shared_state->template cast<SharedState>();
686
152
            _dependency = _shared_state->create_sink_dependency(
687
152
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
152
        }
689
152
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
152
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
152
    }
692
693
152
    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
152
    _rows_input_counter =
698
152
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
152
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
152
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
152
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
152
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
152
    _memory_used_counter =
704
152
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
152
    _common_profile->add_info_string("IsColocate",
706
152
                                     std::to_string(_parent->is_colocated_operator()));
707
152
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
152
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
152
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
152
    return Status::OK();
711
152
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
455k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
455k
    _operator_profile =
654
455k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
455k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
455k
    _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
455k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
455k
    _operator_profile->add_child(_common_profile, true);
663
455k
    _operator_profile->add_child(_custom_profile, true);
664
665
455k
    _operator_profile->set_metadata(_parent->node_id());
666
455k
    _wait_for_finish_dependency_timer =
667
455k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
455k
    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
455k
    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
455k
    _rows_input_counter =
698
455k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
455k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
455k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
455k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
455k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
455k
    _memory_used_counter =
704
455k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
455k
    _common_profile->add_info_string("IsColocate",
706
455k
                                     std::to_string(_parent->is_colocated_operator()));
707
455k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
455k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
455k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
455k
    return Status::OK();
711
455k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
5.39k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
5.39k
    _operator_profile =
654
5.39k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
5.39k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
5.39k
    _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.39k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
5.39k
    _operator_profile->add_child(_common_profile, true);
663
5.39k
    _operator_profile->add_child(_custom_profile, true);
664
665
5.39k
    _operator_profile->set_metadata(_parent->node_id());
666
5.39k
    _wait_for_finish_dependency_timer =
667
5.39k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
5.39k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
5.39k
    if constexpr (!is_fake_shared) {
670
5.39k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
5.39k
            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.39k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
5.39k
            _shared_state = info.shared_state->template cast<SharedState>();
686
5.39k
            _dependency = _shared_state->create_sink_dependency(
687
5.39k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
5.39k
        }
689
5.39k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
5.39k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
5.39k
    }
692
693
5.39k
    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.39k
    _rows_input_counter =
698
5.39k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
5.39k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
5.39k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
5.39k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
5.39k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
5.39k
    _memory_used_counter =
704
5.39k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
5.39k
    _common_profile->add_info_string("IsColocate",
706
5.39k
                                     std::to_string(_parent->is_colocated_operator()));
707
5.39k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
5.39k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
5.39k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
5.39k
    return Status::OK();
711
5.39k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
534
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
534
    _operator_profile =
654
534
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
534
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
534
    _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
534
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
534
    _operator_profile->add_child(_common_profile, true);
663
534
    _operator_profile->add_child(_custom_profile, true);
664
665
534
    _operator_profile->set_metadata(_parent->node_id());
666
534
    _wait_for_finish_dependency_timer =
667
534
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
534
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
534
    if constexpr (!is_fake_shared) {
670
534
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
534
            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
534
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
534
            _shared_state = info.shared_state->template cast<SharedState>();
686
534
            _dependency = _shared_state->create_sink_dependency(
687
534
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
534
        }
689
534
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
534
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
534
    }
692
693
534
    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
534
    _rows_input_counter =
698
534
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
534
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
534
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
534
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
534
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
534
    _memory_used_counter =
704
534
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
534
    _common_profile->add_info_string("IsColocate",
706
534
                                     std::to_string(_parent->is_colocated_operator()));
707
534
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
534
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
534
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
534
    return Status::OK();
711
534
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
651
1.98k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
1.98k
    _operator_profile =
654
1.98k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
1.98k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
1.98k
    _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.98k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
1.98k
    _operator_profile->add_child(_common_profile, true);
663
1.98k
    _operator_profile->add_child(_custom_profile, true);
664
665
1.98k
    _operator_profile->set_metadata(_parent->node_id());
666
1.98k
    _wait_for_finish_dependency_timer =
667
1.98k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
1.98k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
1.98k
    if constexpr (!is_fake_shared) {
670
1.98k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
1.98k
            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.98k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
1.98k
            _shared_state = info.shared_state->template cast<SharedState>();
686
1.98k
            _dependency = _shared_state->create_sink_dependency(
687
1.98k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
1.98k
        }
689
1.98k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
1.98k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
1.98k
    }
692
693
1.98k
    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.98k
    _rows_input_counter =
698
1.98k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
1.98k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
1.98k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
1.98k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
1.98k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
1.98k
    _memory_used_counter =
704
1.98k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
1.98k
    _common_profile->add_info_string("IsColocate",
706
1.98k
                                     std::to_string(_parent->is_colocated_operator()));
707
1.98k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
1.98k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
1.98k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
1.98k
    return Status::OK();
711
1.98k
}
_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
415k
Status PipelineXSinkLocalState<SharedState>::init(RuntimeState* state, LocalSinkStateInfo& info) {
652
    // create profile
653
415k
    _operator_profile =
654
415k
            state->obj_pool()->add(new RuntimeProfile(_parent->get_name() + name_suffix()));
655
415k
    _common_profile = state->obj_pool()->add(new RuntimeProfile(profile::COMMON_COUNTERS));
656
415k
    _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
415k
    info.parent_profile->add_child(_operator_profile, /*indent=*/true);
662
415k
    _operator_profile->add_child(_common_profile, true);
663
415k
    _operator_profile->add_child(_custom_profile, true);
664
665
415k
    _operator_profile->set_metadata(_parent->node_id());
666
415k
    _wait_for_finish_dependency_timer =
667
415k
            ADD_TIMER(_common_profile, profile::PENDING_FINISH_DEPENDENCY);
668
415k
    constexpr auto is_fake_shared = std::is_same_v<SharedState, FakeSharedState>;
669
415k
    if constexpr (!is_fake_shared) {
670
415k
        if (info.shared_state_map.find(_parent->dests_id().front()) !=
671
415k
            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
415k
        } else {
682
            if constexpr (std::is_same_v<LocalExchangeSharedState, SharedState>) {
683
                DCHECK(false);
684
            }
685
415k
            _shared_state = info.shared_state->template cast<SharedState>();
686
415k
            _dependency = _shared_state->create_sink_dependency(
687
415k
                    _parent->dests_id().front(), _parent->node_id(), _parent->get_name());
688
415k
        }
689
415k
        _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
690
415k
                _common_profile, "WaitForDependency[" + _dependency->name() + "]Time", 1);
691
415k
    }
692
693
415k
    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
415k
    _rows_input_counter =
698
415k
            ADD_COUNTER_WITH_LEVEL(_common_profile, profile::INPUT_ROWS, TUnit::UNIT, 1);
699
415k
    _init_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::INIT_TIME, 2);
700
415k
    _open_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::OPEN_TIME, 2);
701
415k
    _close_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::CLOSE_TIME, 2);
702
415k
    _exec_timer = ADD_TIMER_WITH_LEVEL(_common_profile, profile::EXEC_TIME, 1);
703
415k
    _memory_used_counter =
704
415k
            _common_profile->AddHighWaterMarkCounter(profile::MEMORY_USAGE, TUnit::BYTES, "", 1);
705
415k
    _common_profile->add_info_string("IsColocate",
706
415k
                                     std::to_string(_parent->is_colocated_operator()));
707
415k
    _common_profile->add_info_string("IsShuffled", std::to_string(_parent->is_shuffled_operator()));
708
415k
    _common_profile->add_info_string("FollowedByShuffledOperator",
709
415k
                                     std::to_string(_parent->followed_by_shuffled_operator()));
710
415k
    return Status::OK();
711
415k
}
_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.60M
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
1.60M
    if (_closed) {
716
2
        return Status::OK();
717
2
    }
718
1.60M
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
1.14M
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
1.14M
    }
721
1.60M
    _closed = true;
722
1.60M
    return Status::OK();
723
1.60M
}
_ZN5doris23PipelineXSinkLocalStateINS_19HashJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
112k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
112k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
112k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
112k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
112k
    }
721
112k
    _closed = true;
722
112k
    return Status::OK();
723
112k
}
_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
186k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
186k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
186k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
186k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
186k
    }
721
186k
    _closed = true;
722
186k
    return Status::OK();
723
186k
}
_ZN5doris23PipelineXSinkLocalStateINS_20SpillSortSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
23
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
23
    if (_closed) {
716
2
        return Status::OK();
717
2
    }
718
21
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
21
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
21
    }
721
21
    _closed = true;
722
21
    return Status::OK();
723
23
}
_ZN5doris23PipelineXSinkLocalStateINS_25NestedLoopJoinSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
5.78k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
5.78k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
5.78k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
5.78k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
5.78k
    }
721
5.78k
    _closed = true;
722
5.78k
    return Status::OK();
723
5.78k
}
_ZN5doris23PipelineXSinkLocalStateINS_19AnalyticSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
11.8k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
11.8k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
11.8k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
11.8k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
11.8k
    }
721
11.8k
    _closed = true;
722
11.8k
    return Status::OK();
723
11.8k
}
_ZN5doris23PipelineXSinkLocalStateINS_14AggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
83.5k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
83.5k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
83.5k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
83.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
83.5k
    }
721
83.5k
    _closed = true;
722
83.5k
    return Status::OK();
723
83.5k
}
_ZN5doris23PipelineXSinkLocalStateINS_22BucketedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
85.7k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
85.7k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
85.7k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
85.7k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
85.7k
    }
721
85.7k
    _closed = true;
722
85.7k
    return Status::OK();
723
85.7k
}
_ZN5doris23PipelineXSinkLocalStateINS_25PartitionedAggSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
141
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
141
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
141
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
141
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
141
    }
721
141
    _closed = true;
722
141
    return Status::OK();
723
141
}
_ZN5doris23PipelineXSinkLocalStateINS_15FakeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
457k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
457k
    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
457k
    _closed = true;
722
457k
    return Status::OK();
723
457k
}
_ZN5doris23PipelineXSinkLocalStateINS_16UnionSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
5.38k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
5.38k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
5.38k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
5.38k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
5.38k
    }
721
5.38k
    _closed = true;
722
5.38k
    return Status::OK();
723
5.38k
}
_ZN5doris23PipelineXSinkLocalStateINS_28PartitionSortNodeSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
430
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
430
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
430
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
430
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
430
    }
721
430
    _closed = true;
722
430
    return Status::OK();
723
430
}
_ZN5doris23PipelineXSinkLocalStateINS_20MultiCastSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
1.97k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
1.97k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
1.97k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
1.97k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
1.97k
    }
721
1.97k
    _closed = true;
722
1.97k
    return Status::OK();
723
1.97k
}
_ZN5doris23PipelineXSinkLocalStateINS_14SetSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
12.5k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
12.5k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
12.5k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
12.5k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
12.5k
    }
721
12.5k
    _closed = true;
722
12.5k
    return Status::OK();
723
12.5k
}
_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
417k
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
417k
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
417k
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
417k
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
417k
    }
721
417k
    _closed = true;
722
417k
    return Status::OK();
723
417k
}
_ZN5doris23PipelineXSinkLocalStateINS_20DataQueueSharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
14
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
14
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
14
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
14
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
14
    }
721
14
    _closed = true;
722
14
    return Status::OK();
723
14
}
_ZN5doris23PipelineXSinkLocalStateINS_17RecCTESharedStateEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
714
328
Status PipelineXSinkLocalState<SharedState>::close(RuntimeState* state, Status exec_status) {
715
328
    if (_closed) {
716
0
        return Status::OK();
717
0
    }
718
328
    if constexpr (!std::is_same_v<SharedState, FakeSharedState>) {
719
328
        COUNTER_SET(_wait_for_dependency_timer, _dependency->watcher_elapse_time());
720
328
    }
721
328
    _closed = true;
722
328
    return Status::OK();
723
328
}
724
725
template <typename LocalStateType>
726
Status StreamingOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
727
7.62k
                                                          bool* eos) {
728
7.62k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
7.61k
    return pull(state, block, eos);
730
7.62k
}
_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
7.58k
                                                          bool* eos) {
728
7.58k
    RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(state, block, eos));
729
7.58k
    return pull(state, block, eos);
730
7.58k
}
731
732
template <typename LocalStateType>
733
Status StatefulOperatorX<LocalStateType>::get_block_impl(RuntimeState* state, Block* block,
734
499k
                                                         bool* eos) {
735
499k
    auto& local_state = get_local_state(state);
736
499k
    if (need_more_input_data(state)) {
737
469k
        local_state._child_block->clear_column_data(
738
469k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
469k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
469k
                state, local_state._child_block.get(), &local_state._child_eos));
741
469k
        *eos = local_state._child_eos;
742
469k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
49.6k
            return Status::OK();
744
49.6k
        }
745
419k
        {
746
419k
            SCOPED_TIMER(local_state.exec_time_counter());
747
419k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
419k
        }
749
419k
    }
750
751
449k
    if (!need_more_input_data(state)) {
752
424k
        SCOPED_TIMER(local_state.exec_time_counter());
753
424k
        bool new_eos = false;
754
424k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
424k
        if (new_eos) {
756
348k
            *eos = true;
757
348k
        } else if (!need_more_input_data(state)) {
758
24.1k
            *eos = false;
759
24.1k
        }
760
424k
    }
761
449k
    return Status::OK();
762
449k
}
_ZN5doris17StatefulOperatorXINS_23HashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
125k
                                                         bool* eos) {
735
125k
    auto& local_state = get_local_state(state);
736
125k
    if (need_more_input_data(state)) {
737
107k
        local_state._child_block->clear_column_data(
738
107k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
107k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
107k
                state, local_state._child_block.get(), &local_state._child_eos));
741
107k
        *eos = local_state._child_eos;
742
107k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
29.0k
            return Status::OK();
744
29.0k
        }
745
78.7k
        {
746
78.7k
            SCOPED_TIMER(local_state.exec_time_counter());
747
78.7k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
78.7k
        }
749
78.7k
    }
750
751
96.4k
    if (!need_more_input_data(state)) {
752
96.4k
        SCOPED_TIMER(local_state.exec_time_counter());
753
96.4k
        bool new_eos = false;
754
96.4k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
96.4k
        if (new_eos) {
756
40.3k
            *eos = true;
757
56.1k
        } else if (!need_more_input_data(state)) {
758
11.2k
            *eos = false;
759
11.2k
        }
760
96.4k
    }
761
96.4k
    return Status::OK();
762
96.4k
}
Unexecuted instantiation: _ZN5doris17StatefulOperatorXINS_34PartitionedHashJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
_ZN5doris17StatefulOperatorXINS_16RepeatLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
3.91k
                                                         bool* eos) {
735
3.91k
    auto& local_state = get_local_state(state);
736
3.91k
    if (need_more_input_data(state)) {
737
2.08k
        local_state._child_block->clear_column_data(
738
2.08k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
2.08k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
2.08k
                state, local_state._child_block.get(), &local_state._child_eos));
741
2.08k
        *eos = local_state._child_eos;
742
2.08k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
315
            return Status::OK();
744
315
        }
745
1.77k
        {
746
1.77k
            SCOPED_TIMER(local_state.exec_time_counter());
747
1.77k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
1.77k
        }
749
1.77k
    }
750
751
3.61k
    if (!need_more_input_data(state)) {
752
3.61k
        SCOPED_TIMER(local_state.exec_time_counter());
753
3.61k
        bool new_eos = false;
754
3.61k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
3.61k
        if (new_eos) {
756
1.31k
            *eos = true;
757
2.30k
        } else if (!need_more_input_data(state)) {
758
1.80k
            *eos = false;
759
1.80k
        }
760
3.61k
    }
761
3.59k
    return Status::OK();
762
3.59k
}
_ZN5doris17StatefulOperatorXINS_25MaterializationLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
1.78k
                                                         bool* eos) {
735
1.78k
    auto& local_state = get_local_state(state);
736
1.78k
    if (need_more_input_data(state)) {
737
1.78k
        local_state._child_block->clear_column_data(
738
1.78k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
1.78k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
1.78k
                state, local_state._child_block.get(), &local_state._child_eos));
741
1.78k
        *eos = local_state._child_eos;
742
1.78k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
760
            return Status::OK();
744
760
        }
745
1.02k
        {
746
1.02k
            SCOPED_TIMER(local_state.exec_time_counter());
747
1.02k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
1.02k
        }
749
1.02k
    }
750
751
1.02k
    if (!need_more_input_data(state)) {
752
1.02k
        SCOPED_TIMER(local_state.exec_time_counter());
753
1.02k
        bool new_eos = false;
754
1.02k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
1.02k
        if (new_eos) {
756
780
            *eos = true;
757
780
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
1.02k
    }
761
1.02k
    return Status::OK();
762
1.02k
}
_ZN5doris17StatefulOperatorXINS_22StreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
14.6k
                                                         bool* eos) {
735
14.6k
    auto& local_state = get_local_state(state);
736
14.7k
    if (need_more_input_data(state)) {
737
14.7k
        local_state._child_block->clear_column_data(
738
14.7k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
14.7k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
14.7k
                state, local_state._child_block.get(), &local_state._child_eos));
741
14.7k
        *eos = local_state._child_eos;
742
14.7k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
4.21k
            return Status::OK();
744
4.21k
        }
745
10.4k
        {
746
10.4k
            SCOPED_TIMER(local_state.exec_time_counter());
747
10.4k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
10.4k
        }
749
10.4k
    }
750
751
10.4k
    if (!need_more_input_data(state)) {
752
4.56k
        SCOPED_TIMER(local_state.exec_time_counter());
753
4.56k
        bool new_eos = false;
754
4.56k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
4.56k
        if (new_eos) {
756
4.54k
            *eos = true;
757
4.54k
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
4.56k
    }
761
10.4k
    return Status::OK();
762
10.4k
}
_ZN5doris17StatefulOperatorXINS_30DistinctStreamingAggLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
324k
                                                         bool* eos) {
735
324k
    auto& local_state = get_local_state(state);
736
325k
    if (need_more_input_data(state)) {
737
325k
        local_state._child_block->clear_column_data(
738
325k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
325k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
325k
                state, local_state._child_block.get(), &local_state._child_eos));
741
325k
        *eos = local_state._child_eos;
742
325k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
13.4k
            return Status::OK();
744
13.4k
        }
745
311k
        {
746
311k
            SCOPED_TIMER(local_state.exec_time_counter());
747
311k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
311k
        }
749
311k
    }
750
751
310k
    if (!need_more_input_data(state)) {
752
292k
        SCOPED_TIMER(local_state.exec_time_counter());
753
292k
        bool new_eos = false;
754
292k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
292k
        if (new_eos) {
756
291k
            *eos = true;
757
291k
        } else if (!need_more_input_data(state)) {
758
0
            *eos = false;
759
0
        }
760
292k
    }
761
310k
    return Status::OK();
762
310k
}
_ZN5doris17StatefulOperatorXINS_29NestedLoopJoinProbeLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
21.3k
                                                         bool* eos) {
735
21.3k
    auto& local_state = get_local_state(state);
736
21.3k
    if (need_more_input_data(state)) {
737
10.5k
        local_state._child_block->clear_column_data(
738
10.5k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
10.5k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
10.5k
                state, local_state._child_block.get(), &local_state._child_eos));
741
10.5k
        *eos = local_state._child_eos;
742
10.5k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
860
            return Status::OK();
744
860
        }
745
9.72k
        {
746
9.72k
            SCOPED_TIMER(local_state.exec_time_counter());
747
9.72k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
9.72k
        }
749
9.72k
    }
750
751
20.4k
    if (!need_more_input_data(state)) {
752
19.8k
        SCOPED_TIMER(local_state.exec_time_counter());
753
19.8k
        bool new_eos = false;
754
19.8k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
19.8k
        if (new_eos) {
756
5.77k
            *eos = true;
757
14.1k
        } else if (!need_more_input_data(state)) {
758
10.7k
            *eos = false;
759
10.7k
        }
760
19.8k
    }
761
20.4k
    return Status::OK();
762
20.4k
}
_ZN5doris17StatefulOperatorXINS_23TableFunctionLocalStateEE14get_block_implEPNS_12RuntimeStateEPNS_5BlockEPb
Line
Count
Source
734
7.51k
                                                         bool* eos) {
735
7.51k
    auto& local_state = get_local_state(state);
736
7.51k
    if (need_more_input_data(state)) {
737
7.15k
        local_state._child_block->clear_column_data(
738
7.15k
                OperatorX<LocalStateType>::_child->row_desc().num_materialized_slots());
739
7.15k
        RETURN_IF_ERROR(OperatorX<LocalStateType>::_child->get_block_after_projects(
740
7.15k
                state, local_state._child_block.get(), &local_state._child_eos));
741
7.15k
        *eos = local_state._child_eos;
742
7.15k
        if (local_state._child_block->rows() == 0 && !local_state._child_eos) {
743
990
            return Status::OK();
744
990
        }
745
6.16k
        {
746
6.16k
            SCOPED_TIMER(local_state.exec_time_counter());
747
6.16k
            RETURN_IF_ERROR(push(state, local_state._child_block.get(), local_state._child_eos));
748
6.16k
        }
749
6.16k
    }
750
751
6.52k
    if (!need_more_input_data(state)) {
752
6.52k
        SCOPED_TIMER(local_state.exec_time_counter());
753
6.52k
        bool new_eos = false;
754
6.52k
        RETURN_IF_ERROR(pull(state, block, &new_eos));
755
6.52k
        if (new_eos) {
756
4.44k
            *eos = true;
757
4.44k
        } else if (!need_more_input_data(state)) {
758
366
            *eos = false;
759
366
        }
760
6.52k
    }
761
6.52k
    return Status::OK();
762
6.52k
}
763
764
template <typename Writer, typename Parent>
765
    requires(std::is_base_of_v<AsyncResultWriter, Writer>)
766
43.6k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
43.6k
    RETURN_IF_ERROR(Base::init(state, info));
768
43.6k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
43.6k
                                                         "AsyncWriterDependency", true);
770
43.6k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
43.6k
                             _finish_dependency));
772
773
43.6k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
43.6k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
43.6k
    return Status::OK();
776
43.6k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
378
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
378
    RETURN_IF_ERROR(Base::init(state, info));
768
378
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
378
                                                         "AsyncWriterDependency", true);
770
378
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
378
                             _finish_dependency));
772
773
378
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
378
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
378
    return Status::OK();
776
378
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
43.2k
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
43.2k
    RETURN_IF_ERROR(Base::init(state, info));
768
43.2k
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
43.2k
                                                         "AsyncWriterDependency", true);
770
43.2k
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
43.2k
                             _finish_dependency));
772
773
43.2k
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
43.2k
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
43.2k
    return Status::OK();
776
43.2k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4initEPNS_12RuntimeStateERNS_18LocalSinkStateInfoE
Line
Count
Source
766
56
Status AsyncWriterSink<Writer, Parent>::init(RuntimeState* state, LocalSinkStateInfo& info) {
767
56
    RETURN_IF_ERROR(Base::init(state, info));
768
56
    _async_writer_dependency = Dependency::create_shared(_parent->operator_id(), _parent->node_id(),
769
56
                                                         "AsyncWriterDependency", true);
770
56
    _writer.reset(new Writer(info.tsink, _output_vexpr_ctxs, _async_writer_dependency,
771
56
                             _finish_dependency));
772
773
56
    _wait_for_dependency_timer = ADD_TIMER_WITH_LEVEL(
774
56
            common_profile(), "WaitForDependency[" + _async_writer_dependency->name() + "]Time", 1);
775
56
    return Status::OK();
776
56
}
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
44.1k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
44.1k
    RETURN_IF_ERROR(Base::open(state));
782
44.1k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
360k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
315k
        RETURN_IF_ERROR(
785
315k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
315k
    }
787
44.1k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
44.1k
    return Status::OK();
789
44.1k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
377
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
377
    RETURN_IF_ERROR(Base::open(state));
782
377
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
1.91k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
1.53k
        RETURN_IF_ERROR(
785
1.53k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
1.53k
    }
787
377
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
377
    return Status::OK();
789
377
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4openEPNS_12RuntimeStateE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
43.6k
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
43.6k
    RETURN_IF_ERROR(Base::open(state));
782
43.6k
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
357k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
313k
        RETURN_IF_ERROR(
785
313k
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
313k
    }
787
43.6k
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
43.6k
    return Status::OK();
789
43.6k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4openEPNS_12RuntimeStateE
Line
Count
Source
780
56
Status AsyncWriterSink<Writer, Parent>::open(RuntimeState* state) {
781
56
    RETURN_IF_ERROR(Base::open(state));
782
56
    _output_vexpr_ctxs.resize(_parent->cast<Parent>()._output_vexpr_ctxs.size());
783
1.00k
    for (size_t i = 0; i < _output_vexpr_ctxs.size(); i++) {
784
952
        RETURN_IF_ERROR(
785
952
                _parent->cast<Parent>()._output_vexpr_ctxs[i]->clone(state, _output_vexpr_ctxs[i]));
786
952
    }
787
56
    RETURN_IF_ERROR(_writer->start_writer(state, operator_profile()));
788
56
    return Status::OK();
789
56
}
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.4k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
58.4k
    return _writer->sink(block, eos);
795
58.4k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
1.33k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
1.33k
    return _writer->sink(block, eos);
795
1.33k
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
57.0k
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
57.0k
    return _writer->sink(block, eos);
795
57.0k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE4sinkEPNS_12RuntimeStateEPNS_5BlockEb
Line
Count
Source
793
56
Status AsyncWriterSink<Writer, Parent>::sink(RuntimeState* state, Block* block, bool eos) {
794
56
    return _writer->sink(block, eos);
795
56
}
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
44.2k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
44.2k
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
44.2k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
44.2k
    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
44.2k
    if (_writer) {
807
44.2k
        Status st = _writer->get_writer_status();
808
44.2k
        if (exec_status.ok()) {
809
44.1k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
44.1k
                                                       : Status::Cancelled("force close"));
811
44.1k
        } else {
812
53
            _writer->force_close(exec_status);
813
53
        }
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
44.2k
        RETURN_IF_ERROR(st);
818
44.2k
    }
819
44.1k
    return Base::close(state, exec_status);
820
44.2k
}
_ZN5doris15AsyncWriterSinkINS_17VFileResultWriterENS_23ResultFileSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
367
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
367
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
367
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
367
    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
367
    if (_writer) {
807
367
        Status st = _writer->get_writer_status();
808
367
        if (exec_status.ok()) {
809
367
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
367
                                                       : Status::Cancelled("force close"));
811
367
        } 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
367
        RETURN_IF_ERROR(st);
818
367
    }
819
367
    return Base::close(state, exec_status);
820
367
}
Unexecuted instantiation: _ZN5doris15AsyncWriterSinkINS_16VJdbcTableWriterENS_22JdbcTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
_ZN5doris15AsyncWriterSinkINS_13VTabletWriterENS_22OlapTableSinkOperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
43.7k
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
43.7k
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
43.7k
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
43.7k
    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.8k
    if (_writer) {
807
43.8k
        Status st = _writer->get_writer_status();
808
43.8k
        if (exec_status.ok()) {
809
43.7k
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
43.7k
                                                       : Status::Cancelled("force close"));
811
43.7k
        } else {
812
53
            _writer->force_close(exec_status);
813
53
        }
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.8k
        RETURN_IF_ERROR(st);
818
43.8k
    }
819
43.7k
    return Base::close(state, exec_status);
820
43.7k
}
_ZN5doris15AsyncWriterSinkINS_15VTabletWriterV2ENS_24OlapTableSinkV2OperatorXEE5closeEPNS_12RuntimeStateENS_6StatusE
Line
Count
Source
799
56
Status AsyncWriterSink<Writer, Parent>::close(RuntimeState* state, Status exec_status) {
800
56
    if (_closed) {
801
0
        return Status::OK();
802
0
    }
803
56
    COUNTER_SET(_wait_for_dependency_timer, _async_writer_dependency->watcher_elapse_time());
804
56
    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
56
    if (_writer) {
807
56
        Status st = _writer->get_writer_status();
808
56
        if (exec_status.ok()) {
809
56
            _writer->force_close(state->is_cancelled() ? state->cancel_reason()
810
56
                                                       : Status::Cancelled("force close"));
811
56
        } 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
56
        RETURN_IF_ERROR(st);
818
56
    }
819
56
    return Base::close(state, exec_status);
820
56
}
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