Coverage Report

Created: 2026-05-21 21:54

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
be/src/exec/operator/hashjoin_build_sink.h
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
#pragma once
19
20
#include "common/thread_safety_annotations.h"
21
#include "exec/operator/join_build_sink_operator.h"
22
#include "exec/operator/operator.h"
23
#include "exec/runtime_filter/runtime_filter_producer_helper.h"
24
25
namespace doris {
26
class HashJoinBuildSinkOperatorX;
27
28
class HashJoinBuildSinkLocalState MOCK_REMOVE(final)
29
        : public JoinBuildSinkLocalState<HashJoinSharedState, HashJoinBuildSinkLocalState> {
30
public:
31
    ENABLE_FACTORY_CREATOR(HashJoinBuildSinkLocalState);
32
    using Base = JoinBuildSinkLocalState<HashJoinSharedState, HashJoinBuildSinkLocalState>;
33
    using Parent = HashJoinBuildSinkOperatorX;
34
    HashJoinBuildSinkLocalState(DataSinkOperatorXBase* parent, RuntimeState* state);
35
72.0k
    ~HashJoinBuildSinkLocalState() override = default;
36
37
    Status init(RuntimeState* state, LocalSinkStateInfo& info) override;
38
    Status open(RuntimeState* state) override;
39
    Status terminate(RuntimeState* state) override;
40
    Status process_build_block(RuntimeState* state, Block& block);
41
42
    // Build ASOF JOIN pre-sorted index for O(log K) lookup
43
    Status build_asof_index(Block& block);
44
45
    void init_short_circuit_for_probe();
46
47
    bool build_unique() const;
48
49
4
    Dependency* finishdependency() override { return _finish_dependency.get(); }
50
51
    Status close(RuntimeState* state, Status exec_status) override;
52
53
    [[nodiscard]] MOCK_FUNCTION size_t get_reserve_mem_size(RuntimeState* state, bool eos);
54
55
protected:
56
    Status _hash_table_init(RuntimeState* state, const ColumnRawPtrs& raw_ptrs);
57
    void _set_build_side_has_external_nullmap(Block& block, const std::vector<int>& res_col_ids);
58
    Status _do_evaluate(Block& block, VExprContextSPtrs& exprs,
59
                        RuntimeProfile::Counter& expr_call_timer, std::vector<int>& res_col_ids);
60
    std::vector<uint16_t> _convert_block_to_null(Block& block);
61
    Status _extract_join_column(Block& block, ColumnUInt8::MutablePtr& null_map,
62
                                ColumnRawPtrs& raw_ptrs, const std::vector<int>& res_col_ids);
63
    friend class HashJoinBuildSinkOperatorX;
64
    friend class PartitionedHashJoinSinkLocalState;
65
    template <class HashTableContext>
66
    friend struct ProcessHashTableBuild;
67
68
    // build expr
69
    VExprContextSPtrs _build_expr_ctxs;
70
    std::vector<ColumnPtr> _key_columns_holder;
71
72
    bool _should_build_hash_table = true;
73
74
    size_t _evaluate_mem_usage = 0;
75
    size_t _build_side_rows = 0;
76
    int _task_idx;
77
78
    MutableBlock _build_side_mutable_block;
79
    std::shared_ptr<RuntimeFilterProducerHelper> _runtime_filter_producer_helper;
80
81
    /*
82
     * The comparison result of a null value with any other value is null,
83
     * which means that for most join(exclude: null aware join, null equal safe join),
84
     * the result of an equality condition involving null should be false,
85
     * so null does not need to be added to the hash table.
86
     */
87
    bool _build_side_has_external_nullmap = false;
88
    std::vector<int> _build_col_ids;
89
    std::shared_ptr<CountedFinishDependency> _finish_dependency;
90
91
    RuntimeProfile::Counter* _build_table_timer = nullptr;
92
    RuntimeProfile::Counter* _build_expr_call_timer = nullptr;
93
    RuntimeProfile::Counter* _build_table_insert_timer = nullptr;
94
    RuntimeProfile::Counter* _build_side_merge_block_timer = nullptr;
95
96
    RuntimeProfile::Counter* _build_blocks_memory_usage = nullptr;
97
    RuntimeProfile::Counter* _hash_table_memory_usage = nullptr;
98
    RuntimeProfile::Counter* _build_arena_memory_usage = nullptr;
99
100
    // ASOF index build counters
101
    RuntimeProfile::Counter* _asof_index_total_timer = nullptr;
102
    RuntimeProfile::Counter* _asof_index_expr_timer = nullptr;
103
    RuntimeProfile::Counter* _asof_index_sort_timer = nullptr;
104
    RuntimeProfile::Counter* _asof_index_group_timer = nullptr;
105
};
106
107
class HashJoinBuildSinkOperatorX MOCK_REMOVE(final)
108
        : public JoinBuildSinkOperatorX<HashJoinBuildSinkLocalState> {
109
public:
110
    HashJoinBuildSinkOperatorX(ObjectPool* pool, int operator_id, int dest_id,
111
                               const TPlanNode& tnode, const DescriptorTbl& descs);
112
48.0k
    Status init(const TDataSink& tsink) override {
113
48.0k
        return Status::InternalError("{} should not init with TDataSink",
114
48.0k
                                     JoinBuildSinkOperatorX<HashJoinBuildSinkLocalState>::_name);
115
48.0k
    }
116
117
    Status init(const TPlanNode& tnode, RuntimeState* state) override;
118
119
    Status prepare(RuntimeState* state) override;
120
121
    Status sink(RuntimeState* state, Block* in_block, bool eos) override;
122
123
    size_t get_reserve_mem_size(RuntimeState* state, bool eos) override;
124
125
    [[nodiscard]] size_t get_memory_usage(RuntimeState* state) const;
126
127
    MOCK_FUNCTION std::string get_memory_usage_debug_str(RuntimeState* state) const;
128
129
33
    bool should_dry_run(RuntimeState* state) override {
130
33
        return _is_broadcast_join && !state->get_sink_local_state()
131
1
                                              ->cast<HashJoinBuildSinkLocalState>()
132
1
                                              ._should_build_hash_table;
133
33
    }
134
135
33
    DataDistribution required_data_distribution(RuntimeState* /*state*/) const override {
136
33
        if (_join_op == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN) {
137
6
            return {TLocalPartitionType::NOOP};
138
27
        } else if (_is_broadcast_join) {
139
1
            return _child->is_serial_operator() ? DataDistribution(TLocalPartitionType::PASS_TO_ONE)
140
1
                                                : DataDistribution(TLocalPartitionType::NOOP);
141
1
        }
142
26
        return _join_distribution == TJoinDistributionType::BUCKET_SHUFFLE ||
143
26
                               _join_distribution == TJoinDistributionType::COLOCATE
144
26
                       ? DataDistribution(TLocalPartitionType::BUCKET_HASH_SHUFFLE,
145
0
                                          _partition_exprs)
146
26
                       : DataDistribution(TLocalPartitionType::GLOBAL_EXECUTION_HASH_SHUFFLE,
147
26
                                          _partition_exprs);
148
33
    }
149
150
144k
    bool is_shuffled_operator() const override {
151
144k
        return _join_distribution == TJoinDistributionType::PARTITIONED ||
152
144k
               _join_distribution == TJoinDistributionType::BUCKET_SHUFFLE ||
153
144k
               _join_distribution == TJoinDistributionType::COLOCATE;
154
144k
    }
155
72.0k
    bool is_colocated_operator() const override {
156
72.0k
        return _join_distribution == TJoinDistributionType::BUCKET_SHUFFLE ||
157
72.0k
               _join_distribution == TJoinDistributionType::COLOCATE;
158
72.0k
    }
159
72.0k
    bool followed_by_shuffled_operator() const override {
160
72.0k
        return (is_shuffled_operator() && !is_colocated_operator()) ||
161
72.0k
               _followed_by_shuffled_operator;
162
72.0k
    }
163
46.3k
    std::vector<bool>& is_null_safe_eq_join() { return _is_null_safe_eq_join; }
164
165
48.0k
    bool allow_left_semi_direct_return(RuntimeState* state) const {
166
        // only single join conjunct and left semi join can direct return
167
48.0k
        return _join_op == TJoinOp::LEFT_SEMI_JOIN && _build_expr_ctxs.size() == 1 &&
168
48.0k
               !_have_other_join_conjunct && !_is_mark_join &&
169
48.0k
               state->query_options().__isset.enable_left_semi_direct_return_opt &&
170
48.0k
               state->query_options().enable_left_semi_direct_return_opt;
171
48.0k
    }
172
173
private:
174
    friend class HashJoinBuildSinkLocalState;
175
176
    const TJoinDistributionType::type _join_distribution;
177
    // build expr
178
    VExprContextSPtrs _build_expr_ctxs;
179
    // mark the build hash table whether it needs to store null value
180
    std::vector<bool> _serialize_null_into_key;
181
182
    // mark the join column whether support null eq
183
    std::vector<bool> _is_null_safe_eq_join;
184
185
    bool _is_broadcast_join = false;
186
    std::vector<TExpr> _partition_exprs;
187
188
    std::vector<SlotId> _hash_output_slot_ids;
189
    std::vector<bool> _should_keep_column_flags;
190
    bool _should_keep_hash_key_column = false;
191
    // if build side has variant column and need output variant column
192
    // need to finalize variant column to speed up the join op
193
    bool _need_finalize_variant_column = false;
194
195
    // ASOF JOIN: build-side expression extracted from MATCH_CONDITION's right child
196
    // Prepared against build child's row_desc directly (no intermediate tuple needed)
197
    VExprContextSPtr _asof_build_side_expr;
198
    TExprOpcode::type _asof_opcode = TExprOpcode::INVALID_OPCODE;
199
200
    bool _use_shared_hash_table = false;
201
    std::atomic<bool> _signaled = false;
202
    AnnotatedMutex _mutex;
203
    std::vector<std::shared_ptr<Dependency>> _finish_dependencies GUARDED_BY(_mutex);
204
    std::map<int, std::shared_ptr<RuntimeFilterWrapper>> _runtime_filters;
205
};
206
207
template <class HashTableContext>
208
struct ProcessHashTableBuild {
209
    ProcessHashTableBuild(uint32_t rows, ColumnRawPtrs& build_raw_ptrs,
210
                          HashJoinBuildSinkLocalState* parent, int batch_size, RuntimeState* state)
211
48.0k
            : _rows(rows),
212
48.0k
              _build_raw_ptrs(build_raw_ptrs),
213
48.0k
              _parent(parent),
214
48.0k
              _batch_size(batch_size),
215
48.0k
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISC_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
14.1k
            : _rows(rows),
212
14.1k
              _build_raw_ptrs(build_raw_ptrs),
213
14.1k
              _parent(parent),
214
14.1k
              _batch_size(batch_size),
215
14.1k
              _state(state) {}
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISB_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISB_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISB_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISB_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISE_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISE_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISB_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
160
            : _rows(rows),
212
160
              _build_raw_ptrs(build_raw_ptrs),
213
160
              _parent(parent),
214
160
              _batch_size(batch_size),
215
160
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISB_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
80
            : _rows(rows),
212
80
              _build_raw_ptrs(build_raw_ptrs),
213
80
              _parent(parent),
214
80
              _batch_size(batch_size),
215
80
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISB_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
323
            : _rows(rows),
212
323
              _build_raw_ptrs(build_raw_ptrs),
213
323
              _parent(parent),
214
323
              _batch_size(batch_size),
215
323
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISB_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
800
            : _rows(rows),
212
800
              _build_raw_ptrs(build_raw_ptrs),
213
800
              _parent(parent),
214
800
              _batch_size(batch_size),
215
800
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISE_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
240
            : _rows(rows),
212
240
              _build_raw_ptrs(build_raw_ptrs),
213
240
              _parent(parent),
214
240
              _batch_size(batch_size),
215
240
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISB_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
3.92k
            : _rows(rows),
212
3.92k
              _build_raw_ptrs(build_raw_ptrs),
213
3.92k
              _parent(parent),
214
3.92k
              _batch_size(batch_size),
215
3.92k
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISC_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
3.20k
            : _rows(rows),
212
3.20k
              _build_raw_ptrs(build_raw_ptrs),
213
3.20k
              _parent(parent),
214
3.20k
              _batch_size(batch_size),
215
3.20k
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISC_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
8.00k
            : _rows(rows),
212
8.00k
              _build_raw_ptrs(build_raw_ptrs),
213
8.00k
              _parent(parent),
214
8.00k
              _batch_size(batch_size),
215
8.00k
              _state(state) {}
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISC_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISE_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
8.00k
            : _rows(rows),
212
8.00k
              _build_raw_ptrs(build_raw_ptrs),
213
8.00k
              _parent(parent),
214
8.00k
              _batch_size(batch_size),
215
8.00k
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISC_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
960
            : _rows(rows),
212
960
              _build_raw_ptrs(build_raw_ptrs),
213
960
              _parent(parent),
214
960
              _batch_size(batch_size),
215
960
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISE_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
7.92k
            : _rows(rows),
212
7.92k
              _build_raw_ptrs(build_raw_ptrs),
213
7.92k
              _parent(parent),
214
7.92k
              _batch_size(batch_size),
215
7.92k
              _state(state) {}
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEEC2EjRSt6vectorIPKNS_7IColumnESaISC_EEPNS_27HashJoinBuildSinkLocalStateEiPNS_12RuntimeStateE
Line
Count
Source
211
324
            : _rows(rows),
212
324
              _build_raw_ptrs(build_raw_ptrs),
213
324
              _parent(parent),
214
324
              _batch_size(batch_size),
215
324
              _state(state) {}
216
217
    template <int JoinOpType>
218
    Status run(HashTableContext& hash_table_ctx, ConstNullMapPtr null_map, bool* has_null_key,
219
48.0k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
48.0k
        if (null_map) {
221
            // first row is mocked and is null
222
39.2k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
35.5k
                *has_null_key = true;
224
35.5k
            }
225
39.2k
            if (short_circuit_for_null && *has_null_key) {
226
3.55k
                return Status::OK();
227
3.55k
            }
228
39.2k
        }
229
230
44.4k
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
44.4k
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
44.4k
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
44.4k
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
868
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
868
        }
238
239
44.4k
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
44.4k
                                            null_map ? null_map->data() : nullptr, true, true,
241
44.4k
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
44.4k
        bool keep_null_key = false;
244
44.4k
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
44.4k
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
44.4k
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
44.4k
        } else if (_parent->parent()
250
44.4k
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
44.4k
                                   .is_null_safe_eq_join()
252
44.4k
                                   .size() == 1 &&
253
44.4k
                   _parent->parent()
254
1.83k
                           ->cast<HashJoinBuildSinkOperatorX>()
255
1.83k
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
44.4k
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
44.4k
                                         _rows, keep_null_key);
262
44.4k
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
44.4k
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
44.4k
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
44.4k
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
44.4k
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
44.4k
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
44.4k
        return Status::OK();
270
48.0k
    }
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi0EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
1.41k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
1.41k
        if (null_map) {
221
            // first row is mocked and is null
222
1.06k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
1.06k
                *has_null_key = true;
224
1.06k
            }
225
1.06k
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
1.06k
        }
229
230
1.41k
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
1.41k
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
1.41k
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
1.41k
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
1.41k
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
1.41k
                                            null_map ? null_map->data() : nullptr, true, true,
241
1.41k
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
1.41k
        bool keep_null_key = false;
244
1.41k
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
1.41k
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
1.41k
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
1.41k
        } else if (_parent->parent()
250
1.41k
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
1.41k
                                   .is_null_safe_eq_join()
252
1.41k
                                   .size() == 1 &&
253
1.41k
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
1.41k
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
1.41k
                                         _rows, keep_null_key);
262
1.41k
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
1.41k
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
1.41k
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
1.41k
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
1.41k
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
1.41k
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
1.41k
        return Status::OK();
270
1.41k
    }
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi2EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
1.41k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
1.41k
        if (null_map) {
221
            // first row is mocked and is null
222
1.05k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
1.05k
                *has_null_key = true;
224
1.05k
            }
225
1.05k
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
1.05k
        }
229
230
1.41k
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
1.41k
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
1.41k
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
1.41k
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
1.41k
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
1.41k
                                            null_map ? null_map->data() : nullptr, true, true,
241
1.41k
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
1.41k
        bool keep_null_key = false;
244
1.41k
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
1.41k
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
1.41k
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
1.41k
        } else if (_parent->parent()
250
1.41k
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
1.41k
                                   .is_null_safe_eq_join()
252
1.41k
                                   .size() == 1 &&
253
1.41k
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
1.41k
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
1.41k
                                         _rows, keep_null_key);
262
1.41k
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
1.41k
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
1.41k
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
1.41k
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
1.41k
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
1.41k
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
1.41k
        return Status::OK();
270
1.41k
    }
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi8EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
1.41k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
1.41k
        if (null_map) {
221
            // first row is mocked and is null
222
1.05k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
1.05k
                *has_null_key = true;
224
1.05k
            }
225
1.05k
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
1.05k
        }
229
230
1.41k
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
1.41k
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
1.41k
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
1.41k
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
1.41k
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
1.41k
                                            null_map ? null_map->data() : nullptr, true, true,
241
1.41k
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
1.41k
        bool keep_null_key = false;
244
1.41k
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
1.41k
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
1.41k
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
1.41k
        } else if (_parent->parent()
250
1.41k
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
1.41k
                                   .is_null_safe_eq_join()
252
1.41k
                                   .size() == 1 &&
253
1.41k
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
1.41k
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
1.41k
                                         _rows, keep_null_key);
262
1.41k
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
1.41k
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
1.41k
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
1.41k
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
1.41k
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
1.41k
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
1.41k
        return Status::OK();
270
1.41k
    }
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi1EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
1.41k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
1.41k
        if (null_map) {
221
            // first row is mocked and is null
222
1.41k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
1.05k
                *has_null_key = true;
224
1.05k
            }
225
1.41k
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
1.41k
        }
229
230
1.41k
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
1.41k
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
1.41k
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
1.41k
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
1.41k
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
1.41k
                                            null_map ? null_map->data() : nullptr, true, true,
241
1.41k
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
1.41k
        bool keep_null_key = false;
244
1.41k
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
1.41k
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
1.41k
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
1.41k
        } else if (_parent->parent()
250
1.41k
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
1.41k
                                   .is_null_safe_eq_join()
252
1.41k
                                   .size() == 1 &&
253
1.41k
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
1.41k
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
1.41k
                                         _rows, keep_null_key);
262
1.41k
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
1.41k
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
1.41k
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
1.41k
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
1.41k
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
1.41k
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
1.41k
        return Status::OK();
270
1.41k
    }
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi4EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
1.41k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
1.41k
        if (null_map) {
221
            // first row is mocked and is null
222
1.41k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
1.05k
                *has_null_key = true;
224
1.05k
            }
225
1.41k
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
1.41k
        }
229
230
1.41k
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
1.41k
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
1.41k
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
1.41k
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
1.41k
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
1.41k
                                            null_map ? null_map->data() : nullptr, true, true,
241
1.41k
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
1.41k
        bool keep_null_key = false;
244
1.41k
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
1.41k
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
1.41k
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
1.41k
        } else if (_parent->parent()
250
1.41k
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
1.41k
                                   .is_null_safe_eq_join()
252
1.41k
                                   .size() == 1 &&
253
1.41k
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
1.41k
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
1.41k
                                         _rows, keep_null_key);
262
1.41k
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
1.41k
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
1.41k
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
1.41k
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
1.41k
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
1.41k
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
1.41k
        return Status::OK();
270
1.41k
    }
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi3EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
1.41k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
1.41k
        if (null_map) {
221
            // first row is mocked and is null
222
1.05k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
1.05k
                *has_null_key = true;
224
1.05k
            }
225
1.05k
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
1.05k
        }
229
230
1.41k
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
1.41k
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
1.41k
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
1.41k
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
1.41k
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
1.41k
                                            null_map ? null_map->data() : nullptr, true, true,
241
1.41k
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
1.41k
        bool keep_null_key = false;
244
1.41k
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
1.41k
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
1.41k
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
1.41k
        } else if (_parent->parent()
250
1.41k
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
1.41k
                                   .is_null_safe_eq_join()
252
1.41k
                                   .size() == 1 &&
253
1.41k
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
1.41k
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
1.41k
                                         _rows, keep_null_key);
262
1.41k
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
1.41k
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
1.41k
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
1.41k
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
1.41k
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
1.41k
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
1.41k
        return Status::OK();
270
1.41k
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi5EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi7EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
1.40k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
1.40k
        if (null_map) {
221
            // first row is mocked and is null
222
1.05k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
1.05k
                *has_null_key = true;
224
1.05k
            }
225
1.05k
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
1.05k
        }
229
230
1.40k
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
1.40k
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
1.40k
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
1.40k
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
1.40k
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
1.40k
                                            null_map ? null_map->data() : nullptr, true, true,
241
1.40k
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
1.40k
        bool keep_null_key = false;
244
1.40k
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
1.40k
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
1.40k
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
1.40k
        } else if (_parent->parent()
250
1.40k
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
1.40k
                                   .is_null_safe_eq_join()
252
1.40k
                                   .size() == 1 &&
253
1.40k
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
1.40k
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
1.40k
                                         _rows, keep_null_key);
262
1.40k
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
1.40k
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
1.40k
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
1.40k
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
1.40k
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
1.40k
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
1.40k
        return Status::OK();
270
1.40k
    }
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi9EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
1.40k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
1.40k
        if (null_map) {
221
            // first row is mocked and is null
222
1.05k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
1.05k
                *has_null_key = true;
224
1.05k
            }
225
1.05k
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
1.05k
        }
229
230
1.40k
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
1.40k
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
1.40k
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
1.40k
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
1.40k
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
1.40k
                                            null_map ? null_map->data() : nullptr, true, true,
241
1.40k
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
1.40k
        bool keep_null_key = false;
244
1.40k
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
1.40k
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
1.40k
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
1.40k
        } else if (_parent->parent()
250
1.40k
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
1.40k
                                   .is_null_safe_eq_join()
252
1.40k
                                   .size() == 1 &&
253
1.40k
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
1.40k
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
1.40k
                                         _rows, keep_null_key);
262
1.40k
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
1.40k
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
1.40k
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
1.40k
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
1.40k
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
1.40k
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
1.40k
        return Status::OK();
270
1.40k
    }
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi10EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
1.41k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
1.41k
        if (null_map) {
221
            // first row is mocked and is null
222
1.41k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
1.06k
                *has_null_key = true;
224
1.06k
            }
225
1.41k
            if (short_circuit_for_null && *has_null_key) {
226
1.05k
                return Status::OK();
227
1.05k
            }
228
1.41k
        }
229
230
355
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
355
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
355
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
355
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
355
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
355
                                            null_map ? null_map->data() : nullptr, true, true,
241
355
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
355
        bool keep_null_key = false;
244
355
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
355
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
355
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
355
        } else if (_parent->parent()
250
355
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
355
                                   .is_null_safe_eq_join()
252
355
                                   .size() == 1 &&
253
355
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
355
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
355
                                         _rows, keep_null_key);
262
355
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
355
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
355
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
355
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
355
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
355
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
355
        return Status::OK();
270
1.41k
    }
_ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi11EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
1.40k
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
1.40k
        if (null_map) {
221
            // first row is mocked and is null
222
1.05k
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
1.05k
                *has_null_key = true;
224
1.05k
            }
225
1.05k
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
1.05k
        }
229
230
1.40k
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
1.40k
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
1.40k
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
1.40k
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
1.40k
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
1.40k
                                            null_map ? null_map->data() : nullptr, true, true,
241
1.40k
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
1.40k
        bool keep_null_key = false;
244
1.40k
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
1.40k
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
1.40k
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
1.40k
        } else if (_parent->parent()
250
1.40k
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
1.40k
                                   .is_null_safe_eq_join()
252
1.40k
                                   .size() == 1 &&
253
1.40k
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
1.40k
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
1.40k
                                         _rows, keep_null_key);
262
1.40k
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
1.40k
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
1.40k
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
1.40k
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
1.40k
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
1.40k
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
1.40k
        return Status::OK();
270
1.40k
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi12EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_16MethodSerializedINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi14EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi0EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi2EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi8EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi1EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi4EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi3EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi5EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi7EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi9EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi10EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi11EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi12EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb0EEEEEE3runILi14EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi0EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi2EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi8EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi1EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi4EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi3EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi5EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi7EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi9EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi10EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi11EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi12EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb0EEEEEE3runILi14EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi0EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi2EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi8EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi1EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi4EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi3EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi5EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi7EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi9EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi10EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi11EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi12EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb0EEEEEE3runILi14EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi0EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi2EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi8EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi1EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi4EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi3EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi5EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi7EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi9EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi10EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi11EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi12EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi14EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi0EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi2EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi8EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi1EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi4EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi3EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi5EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi7EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi9EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi10EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi11EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi12EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi14EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi0EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi2EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi8EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi1EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi4EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi3EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi5EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi7EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi9EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi10EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi11EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi12EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodOneNumberIN4wide7integerILm256EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb0EEEEEE3runILi14EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi0EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
16
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
16
        if (null_map) {
221
            // first row is mocked and is null
222
8
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
8
                *has_null_key = true;
224
8
            }
225
8
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
8
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
8
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
8
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
16
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi2EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
16
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
16
        if (null_map) {
221
            // first row is mocked and is null
222
8
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
8
                *has_null_key = true;
224
8
            }
225
8
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
8
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
8
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
8
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
16
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi8EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
16
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
16
        if (null_map) {
221
            // first row is mocked and is null
222
8
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
8
                *has_null_key = true;
224
8
            }
225
8
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
8
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
8
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
8
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
16
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi1EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
16
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
16
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
8
                *has_null_key = true;
224
8
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
8
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
8
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
16
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi4EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
16
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
16
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
8
                *has_null_key = true;
224
8
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
8
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
8
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
16
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi3EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
16
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
16
        if (null_map) {
221
            // first row is mocked and is null
222
8
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
8
                *has_null_key = true;
224
8
            }
225
8
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
8
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
8
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
8
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
16
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi5EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi7EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
16
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
16
        if (null_map) {
221
            // first row is mocked and is null
222
8
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
8
                *has_null_key = true;
224
8
            }
225
8
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
8
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
8
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
8
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
16
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi9EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
16
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
16
        if (null_map) {
221
            // first row is mocked and is null
222
8
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
8
                *has_null_key = true;
224
8
            }
225
8
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
8
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
8
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
8
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
16
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi10EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
16
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
16
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
8
                *has_null_key = true;
224
8
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
8
                return Status::OK();
227
8
            }
228
16
        }
229
230
8
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
8
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
8
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
8
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
8
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
8
                                            null_map ? null_map->data() : nullptr, true, true,
241
8
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
8
        bool keep_null_key = false;
244
8
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
8
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
8
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
8
        } else if (_parent->parent()
250
8
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
8
                                   .is_null_safe_eq_join()
252
8
                                   .size() == 1 &&
253
8
                   _parent->parent()
254
8
                           ->cast<HashJoinBuildSinkOperatorX>()
255
8
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
8
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
8
                                         _rows, keep_null_key);
262
8
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
8
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
8
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
8
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
8
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
8
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
8
        return Status::OK();
270
16
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi11EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
16
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
16
        if (null_map) {
221
            // first row is mocked and is null
222
8
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
8
                *has_null_key = true;
224
8
            }
225
8
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
8
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
8
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
8
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
16
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi12EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIhNS_13JoinHashTableIhNS_17HashCRC32Return32IhEELb1EEEEEE3runILi14EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi0EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
8
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
8
        if (null_map) {
221
            // first row is mocked and is null
222
4
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
4
                *has_null_key = true;
224
4
            }
225
4
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
4
        }
229
230
8
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
8
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
8
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
8
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
4
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
4
        }
238
239
8
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
8
                                            null_map ? null_map->data() : nullptr, true, true,
241
8
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
8
        bool keep_null_key = false;
244
8
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
8
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
8
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
8
        } else if (_parent->parent()
250
8
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
8
                                   .is_null_safe_eq_join()
252
8
                                   .size() == 1 &&
253
8
                   _parent->parent()
254
8
                           ->cast<HashJoinBuildSinkOperatorX>()
255
8
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
8
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
8
                                         _rows, keep_null_key);
262
8
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
8
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
8
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
8
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
8
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
8
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
8
        return Status::OK();
270
8
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi2EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
8
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
8
        if (null_map) {
221
            // first row is mocked and is null
222
4
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
4
                *has_null_key = true;
224
4
            }
225
4
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
4
        }
229
230
8
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
8
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
8
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
8
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
4
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
4
        }
238
239
8
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
8
                                            null_map ? null_map->data() : nullptr, true, true,
241
8
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
8
        bool keep_null_key = false;
244
8
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
8
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
8
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
8
        } else if (_parent->parent()
250
8
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
8
                                   .is_null_safe_eq_join()
252
8
                                   .size() == 1 &&
253
8
                   _parent->parent()
254
8
                           ->cast<HashJoinBuildSinkOperatorX>()
255
8
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
8
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
8
                                         _rows, keep_null_key);
262
8
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
8
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
8
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
8
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
8
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
8
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
8
        return Status::OK();
270
8
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi8EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
8
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
8
        if (null_map) {
221
            // first row is mocked and is null
222
4
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
4
                *has_null_key = true;
224
4
            }
225
4
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
4
        }
229
230
8
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
8
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
8
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
8
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
4
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
4
        }
238
239
8
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
8
                                            null_map ? null_map->data() : nullptr, true, true,
241
8
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
8
        bool keep_null_key = false;
244
8
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
8
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
8
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
8
        } else if (_parent->parent()
250
8
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
8
                                   .is_null_safe_eq_join()
252
8
                                   .size() == 1 &&
253
8
                   _parent->parent()
254
8
                           ->cast<HashJoinBuildSinkOperatorX>()
255
8
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
8
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
8
                                         _rows, keep_null_key);
262
8
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
8
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
8
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
8
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
8
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
8
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
8
        return Status::OK();
270
8
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi1EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
8
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
8
        if (null_map) {
221
            // first row is mocked and is null
222
8
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
4
                *has_null_key = true;
224
4
            }
225
8
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
8
        }
229
230
8
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
8
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
8
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
8
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
4
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
4
        }
238
239
8
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
8
                                            null_map ? null_map->data() : nullptr, true, true,
241
8
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
8
        bool keep_null_key = false;
244
8
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
8
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
8
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
8
        } else if (_parent->parent()
250
8
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
8
                                   .is_null_safe_eq_join()
252
8
                                   .size() == 1 &&
253
8
                   _parent->parent()
254
8
                           ->cast<HashJoinBuildSinkOperatorX>()
255
8
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
8
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
8
                                         _rows, keep_null_key);
262
8
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
8
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
8
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
8
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
8
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
8
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
8
        return Status::OK();
270
8
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi4EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
8
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
8
        if (null_map) {
221
            // first row is mocked and is null
222
8
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
4
                *has_null_key = true;
224
4
            }
225
8
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
8
        }
229
230
8
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
8
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
8
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
8
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
4
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
4
        }
238
239
8
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
8
                                            null_map ? null_map->data() : nullptr, true, true,
241
8
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
8
        bool keep_null_key = false;
244
8
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
8
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
8
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
8
        } else if (_parent->parent()
250
8
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
8
                                   .is_null_safe_eq_join()
252
8
                                   .size() == 1 &&
253
8
                   _parent->parent()
254
8
                           ->cast<HashJoinBuildSinkOperatorX>()
255
8
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
8
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
8
                                         _rows, keep_null_key);
262
8
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
8
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
8
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
8
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
8
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
8
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
8
        return Status::OK();
270
8
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi3EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
8
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
8
        if (null_map) {
221
            // first row is mocked and is null
222
4
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
4
                *has_null_key = true;
224
4
            }
225
4
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
4
        }
229
230
8
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
8
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
8
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
8
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
4
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
4
        }
238
239
8
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
8
                                            null_map ? null_map->data() : nullptr, true, true,
241
8
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
8
        bool keep_null_key = false;
244
8
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
8
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
8
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
8
        } else if (_parent->parent()
250
8
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
8
                                   .is_null_safe_eq_join()
252
8
                                   .size() == 1 &&
253
8
                   _parent->parent()
254
8
                           ->cast<HashJoinBuildSinkOperatorX>()
255
8
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
8
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
8
                                         _rows, keep_null_key);
262
8
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
8
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
8
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
8
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
8
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
8
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
8
        return Status::OK();
270
8
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi5EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi7EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
8
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
8
        if (null_map) {
221
            // first row is mocked and is null
222
4
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
4
                *has_null_key = true;
224
4
            }
225
4
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
4
        }
229
230
8
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
8
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
8
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
8
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
4
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
4
        }
238
239
8
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
8
                                            null_map ? null_map->data() : nullptr, true, true,
241
8
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
8
        bool keep_null_key = false;
244
8
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
8
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
8
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
8
        } else if (_parent->parent()
250
8
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
8
                                   .is_null_safe_eq_join()
252
8
                                   .size() == 1 &&
253
8
                   _parent->parent()
254
8
                           ->cast<HashJoinBuildSinkOperatorX>()
255
8
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
8
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
8
                                         _rows, keep_null_key);
262
8
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
8
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
8
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
8
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
8
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
8
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
8
        return Status::OK();
270
8
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi9EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
8
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
8
        if (null_map) {
221
            // first row is mocked and is null
222
4
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
4
                *has_null_key = true;
224
4
            }
225
4
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
4
        }
229
230
8
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
8
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
8
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
8
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
4
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
4
        }
238
239
8
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
8
                                            null_map ? null_map->data() : nullptr, true, true,
241
8
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
8
        bool keep_null_key = false;
244
8
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
8
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
8
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
8
        } else if (_parent->parent()
250
8
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
8
                                   .is_null_safe_eq_join()
252
8
                                   .size() == 1 &&
253
8
                   _parent->parent()
254
8
                           ->cast<HashJoinBuildSinkOperatorX>()
255
8
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
8
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
8
                                         _rows, keep_null_key);
262
8
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
8
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
8
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
8
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
8
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
8
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
8
        return Status::OK();
270
8
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi10EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
8
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
8
        if (null_map) {
221
            // first row is mocked and is null
222
8
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
4
                *has_null_key = true;
224
4
            }
225
8
            if (short_circuit_for_null && *has_null_key) {
226
4
                return Status::OK();
227
4
            }
228
8
        }
229
230
4
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
4
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
4
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
4
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
4
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
4
                                            null_map ? null_map->data() : nullptr, true, true,
241
4
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
4
        bool keep_null_key = false;
244
4
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
4
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
4
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
4
        } else if (_parent->parent()
250
4
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
4
                                   .is_null_safe_eq_join()
252
4
                                   .size() == 1 &&
253
4
                   _parent->parent()
254
4
                           ->cast<HashJoinBuildSinkOperatorX>()
255
4
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
4
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
4
                                         _rows, keep_null_key);
262
4
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
4
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
4
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
4
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
4
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
4
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
4
        return Status::OK();
270
8
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi11EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
8
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
8
        if (null_map) {
221
            // first row is mocked and is null
222
4
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
4
                *has_null_key = true;
224
4
            }
225
4
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
4
        }
229
230
8
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
8
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
8
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
8
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
4
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
4
        }
238
239
8
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
8
                                            null_map ? null_map->data() : nullptr, true, true,
241
8
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
8
        bool keep_null_key = false;
244
8
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
8
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
8
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
8
        } else if (_parent->parent()
250
8
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
8
                                   .is_null_safe_eq_join()
252
8
                                   .size() == 1 &&
253
8
                   _parent->parent()
254
8
                           ->cast<HashJoinBuildSinkOperatorX>()
255
8
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
8
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
8
                                         _rows, keep_null_key);
262
8
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
8
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
8
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
8
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
8
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
8
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
8
        return Status::OK();
270
8
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi12EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectItNS_13JoinHashTableItNS_17HashCRC32Return32ItEELb1EEEEEE3runILi14EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi0EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
35
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
35
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
35
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
35
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
35
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
35
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
35
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
35
                                            null_map ? null_map->data() : nullptr, true, true,
241
35
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
35
        bool keep_null_key = false;
244
35
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
35
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
35
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
35
        } else if (_parent->parent()
250
35
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
35
                                   .is_null_safe_eq_join()
252
35
                                   .size() == 1 &&
253
35
                   _parent->parent()
254
35
                           ->cast<HashJoinBuildSinkOperatorX>()
255
35
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
35
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
35
                                         _rows, keep_null_key);
262
35
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
35
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
35
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
35
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
35
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
35
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
35
        return Status::OK();
270
35
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi2EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi8EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi1EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
32
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
32
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
32
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi4EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
32
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
32
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
32
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi3EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi5EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi7EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi9EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi10EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
32
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
32
            if (short_circuit_for_null && *has_null_key) {
226
16
                return Status::OK();
227
16
            }
228
32
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi11EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi12EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIjNS_13JoinHashTableIjNS_17HashCRC32Return32IjEELb1EEEEEE3runILi14EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi0EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
80
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
80
        if (null_map) {
221
            // first row is mocked and is null
222
40
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
40
                *has_null_key = true;
224
40
            }
225
40
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
40
        }
229
230
80
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
80
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
80
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
80
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
40
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
40
        }
238
239
80
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
80
                                            null_map ? null_map->data() : nullptr, true, true,
241
80
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
80
        bool keep_null_key = false;
244
80
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
80
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
80
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
80
        } else if (_parent->parent()
250
80
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
80
                                   .is_null_safe_eq_join()
252
80
                                   .size() == 1 &&
253
80
                   _parent->parent()
254
80
                           ->cast<HashJoinBuildSinkOperatorX>()
255
80
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
80
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
80
                                         _rows, keep_null_key);
262
80
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
80
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
80
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
80
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
80
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
80
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
80
        return Status::OK();
270
80
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi2EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
80
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
80
        if (null_map) {
221
            // first row is mocked and is null
222
40
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
40
                *has_null_key = true;
224
40
            }
225
40
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
40
        }
229
230
80
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
80
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
80
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
80
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
40
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
40
        }
238
239
80
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
80
                                            null_map ? null_map->data() : nullptr, true, true,
241
80
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
80
        bool keep_null_key = false;
244
80
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
80
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
80
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
80
        } else if (_parent->parent()
250
80
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
80
                                   .is_null_safe_eq_join()
252
80
                                   .size() == 1 &&
253
80
                   _parent->parent()
254
80
                           ->cast<HashJoinBuildSinkOperatorX>()
255
80
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
80
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
80
                                         _rows, keep_null_key);
262
80
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
80
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
80
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
80
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
80
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
80
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
80
        return Status::OK();
270
80
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi8EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
80
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
80
        if (null_map) {
221
            // first row is mocked and is null
222
40
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
40
                *has_null_key = true;
224
40
            }
225
40
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
40
        }
229
230
80
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
80
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
80
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
80
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
40
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
40
        }
238
239
80
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
80
                                            null_map ? null_map->data() : nullptr, true, true,
241
80
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
80
        bool keep_null_key = false;
244
80
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
80
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
80
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
80
        } else if (_parent->parent()
250
80
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
80
                                   .is_null_safe_eq_join()
252
80
                                   .size() == 1 &&
253
80
                   _parent->parent()
254
80
                           ->cast<HashJoinBuildSinkOperatorX>()
255
80
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
80
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
80
                                         _rows, keep_null_key);
262
80
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
80
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
80
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
80
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
80
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
80
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
80
        return Status::OK();
270
80
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi1EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
80
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
80
        if (null_map) {
221
            // first row is mocked and is null
222
80
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
40
                *has_null_key = true;
224
40
            }
225
80
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
80
        }
229
230
80
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
80
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
80
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
80
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
40
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
40
        }
238
239
80
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
80
                                            null_map ? null_map->data() : nullptr, true, true,
241
80
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
80
        bool keep_null_key = false;
244
80
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
80
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
80
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
80
        } else if (_parent->parent()
250
80
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
80
                                   .is_null_safe_eq_join()
252
80
                                   .size() == 1 &&
253
80
                   _parent->parent()
254
80
                           ->cast<HashJoinBuildSinkOperatorX>()
255
80
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
80
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
80
                                         _rows, keep_null_key);
262
80
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
80
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
80
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
80
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
80
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
80
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
80
        return Status::OK();
270
80
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi4EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
80
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
80
        if (null_map) {
221
            // first row is mocked and is null
222
80
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
40
                *has_null_key = true;
224
40
            }
225
80
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
80
        }
229
230
80
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
80
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
80
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
80
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
40
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
40
        }
238
239
80
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
80
                                            null_map ? null_map->data() : nullptr, true, true,
241
80
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
80
        bool keep_null_key = false;
244
80
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
80
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
80
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
80
        } else if (_parent->parent()
250
80
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
80
                                   .is_null_safe_eq_join()
252
80
                                   .size() == 1 &&
253
80
                   _parent->parent()
254
80
                           ->cast<HashJoinBuildSinkOperatorX>()
255
80
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
80
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
80
                                         _rows, keep_null_key);
262
80
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
80
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
80
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
80
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
80
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
80
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
80
        return Status::OK();
270
80
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi3EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
80
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
80
        if (null_map) {
221
            // first row is mocked and is null
222
40
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
40
                *has_null_key = true;
224
40
            }
225
40
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
40
        }
229
230
80
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
80
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
80
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
80
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
40
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
40
        }
238
239
80
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
80
                                            null_map ? null_map->data() : nullptr, true, true,
241
80
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
80
        bool keep_null_key = false;
244
80
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
80
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
80
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
80
        } else if (_parent->parent()
250
80
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
80
                                   .is_null_safe_eq_join()
252
80
                                   .size() == 1 &&
253
80
                   _parent->parent()
254
80
                           ->cast<HashJoinBuildSinkOperatorX>()
255
80
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
80
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
80
                                         _rows, keep_null_key);
262
80
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
80
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
80
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
80
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
80
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
80
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
80
        return Status::OK();
270
80
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi5EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi7EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
80
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
80
        if (null_map) {
221
            // first row is mocked and is null
222
40
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
40
                *has_null_key = true;
224
40
            }
225
40
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
40
        }
229
230
80
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
80
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
80
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
80
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
40
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
40
        }
238
239
80
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
80
                                            null_map ? null_map->data() : nullptr, true, true,
241
80
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
80
        bool keep_null_key = false;
244
80
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
80
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
80
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
80
        } else if (_parent->parent()
250
80
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
80
                                   .is_null_safe_eq_join()
252
80
                                   .size() == 1 &&
253
80
                   _parent->parent()
254
80
                           ->cast<HashJoinBuildSinkOperatorX>()
255
80
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
80
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
80
                                         _rows, keep_null_key);
262
80
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
80
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
80
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
80
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
80
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
80
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
80
        return Status::OK();
270
80
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi9EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
80
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
80
        if (null_map) {
221
            // first row is mocked and is null
222
40
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
40
                *has_null_key = true;
224
40
            }
225
40
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
40
        }
229
230
80
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
80
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
80
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
80
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
40
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
40
        }
238
239
80
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
80
                                            null_map ? null_map->data() : nullptr, true, true,
241
80
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
80
        bool keep_null_key = false;
244
80
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
80
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
80
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
80
        } else if (_parent->parent()
250
80
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
80
                                   .is_null_safe_eq_join()
252
80
                                   .size() == 1 &&
253
80
                   _parent->parent()
254
80
                           ->cast<HashJoinBuildSinkOperatorX>()
255
80
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
80
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
80
                                         _rows, keep_null_key);
262
80
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
80
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
80
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
80
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
80
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
80
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
80
        return Status::OK();
270
80
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi10EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
80
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
80
        if (null_map) {
221
            // first row is mocked and is null
222
80
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
40
                *has_null_key = true;
224
40
            }
225
80
            if (short_circuit_for_null && *has_null_key) {
226
40
                return Status::OK();
227
40
            }
228
80
        }
229
230
40
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
40
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
40
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
40
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
40
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
40
                                            null_map ? null_map->data() : nullptr, true, true,
241
40
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
40
        bool keep_null_key = false;
244
40
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
40
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
40
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
40
        } else if (_parent->parent()
250
40
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
40
                                   .is_null_safe_eq_join()
252
40
                                   .size() == 1 &&
253
40
                   _parent->parent()
254
40
                           ->cast<HashJoinBuildSinkOperatorX>()
255
40
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
40
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
40
                                         _rows, keep_null_key);
262
40
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
40
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
40
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
40
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
40
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
40
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
40
        return Status::OK();
270
80
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi11EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
80
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
80
        if (null_map) {
221
            // first row is mocked and is null
222
40
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
40
                *has_null_key = true;
224
40
            }
225
40
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
40
        }
229
230
80
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
80
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
80
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
80
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
40
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
40
        }
238
239
80
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
80
                                            null_map ? null_map->data() : nullptr, true, true,
241
80
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
80
        bool keep_null_key = false;
244
80
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
80
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
80
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
80
        } else if (_parent->parent()
250
80
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
80
                                   .is_null_safe_eq_join()
252
80
                                   .size() == 1 &&
253
80
                   _parent->parent()
254
80
                           ->cast<HashJoinBuildSinkOperatorX>()
255
80
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
80
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
80
                                         _rows, keep_null_key);
262
80
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
80
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
80
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
80
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
80
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
80
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
80
        return Status::OK();
270
80
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi12EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectImNS_13JoinHashTableImNS_17HashCRC32Return32ImEELb1EEEEEE3runILi14EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi0EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
24
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
24
        if (null_map) {
221
            // first row is mocked and is null
222
12
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
12
                *has_null_key = true;
224
12
            }
225
12
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
12
        }
229
230
24
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
24
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
24
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
24
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
12
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
12
        }
238
239
24
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
24
                                            null_map ? null_map->data() : nullptr, true, true,
241
24
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
24
        bool keep_null_key = false;
244
24
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
24
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
24
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
24
        } else if (_parent->parent()
250
24
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
24
                                   .is_null_safe_eq_join()
252
24
                                   .size() == 1 &&
253
24
                   _parent->parent()
254
24
                           ->cast<HashJoinBuildSinkOperatorX>()
255
24
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
24
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
24
                                         _rows, keep_null_key);
262
24
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
24
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
24
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
24
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
24
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
24
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
24
        return Status::OK();
270
24
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi2EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
24
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
24
        if (null_map) {
221
            // first row is mocked and is null
222
12
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
12
                *has_null_key = true;
224
12
            }
225
12
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
12
        }
229
230
24
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
24
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
24
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
24
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
12
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
12
        }
238
239
24
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
24
                                            null_map ? null_map->data() : nullptr, true, true,
241
24
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
24
        bool keep_null_key = false;
244
24
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
24
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
24
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
24
        } else if (_parent->parent()
250
24
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
24
                                   .is_null_safe_eq_join()
252
24
                                   .size() == 1 &&
253
24
                   _parent->parent()
254
24
                           ->cast<HashJoinBuildSinkOperatorX>()
255
24
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
24
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
24
                                         _rows, keep_null_key);
262
24
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
24
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
24
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
24
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
24
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
24
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
24
        return Status::OK();
270
24
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi8EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
24
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
24
        if (null_map) {
221
            // first row is mocked and is null
222
12
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
12
                *has_null_key = true;
224
12
            }
225
12
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
12
        }
229
230
24
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
24
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
24
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
24
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
12
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
12
        }
238
239
24
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
24
                                            null_map ? null_map->data() : nullptr, true, true,
241
24
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
24
        bool keep_null_key = false;
244
24
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
24
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
24
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
24
        } else if (_parent->parent()
250
24
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
24
                                   .is_null_safe_eq_join()
252
24
                                   .size() == 1 &&
253
24
                   _parent->parent()
254
24
                           ->cast<HashJoinBuildSinkOperatorX>()
255
24
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
24
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
24
                                         _rows, keep_null_key);
262
24
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
24
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
24
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
24
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
24
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
24
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
24
        return Status::OK();
270
24
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi1EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
24
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
24
        if (null_map) {
221
            // first row is mocked and is null
222
24
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
12
                *has_null_key = true;
224
12
            }
225
24
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
24
        }
229
230
24
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
24
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
24
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
24
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
12
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
12
        }
238
239
24
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
24
                                            null_map ? null_map->data() : nullptr, true, true,
241
24
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
24
        bool keep_null_key = false;
244
24
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
24
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
24
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
24
        } else if (_parent->parent()
250
24
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
24
                                   .is_null_safe_eq_join()
252
24
                                   .size() == 1 &&
253
24
                   _parent->parent()
254
24
                           ->cast<HashJoinBuildSinkOperatorX>()
255
24
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
24
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
24
                                         _rows, keep_null_key);
262
24
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
24
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
24
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
24
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
24
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
24
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
24
        return Status::OK();
270
24
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi4EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
24
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
24
        if (null_map) {
221
            // first row is mocked and is null
222
24
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
12
                *has_null_key = true;
224
12
            }
225
24
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
24
        }
229
230
24
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
24
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
24
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
24
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
12
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
12
        }
238
239
24
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
24
                                            null_map ? null_map->data() : nullptr, true, true,
241
24
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
24
        bool keep_null_key = false;
244
24
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
24
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
24
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
24
        } else if (_parent->parent()
250
24
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
24
                                   .is_null_safe_eq_join()
252
24
                                   .size() == 1 &&
253
24
                   _parent->parent()
254
24
                           ->cast<HashJoinBuildSinkOperatorX>()
255
24
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
24
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
24
                                         _rows, keep_null_key);
262
24
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
24
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
24
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
24
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
24
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
24
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
24
        return Status::OK();
270
24
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi3EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
24
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
24
        if (null_map) {
221
            // first row is mocked and is null
222
12
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
12
                *has_null_key = true;
224
12
            }
225
12
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
12
        }
229
230
24
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
24
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
24
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
24
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
12
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
12
        }
238
239
24
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
24
                                            null_map ? null_map->data() : nullptr, true, true,
241
24
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
24
        bool keep_null_key = false;
244
24
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
24
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
24
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
24
        } else if (_parent->parent()
250
24
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
24
                                   .is_null_safe_eq_join()
252
24
                                   .size() == 1 &&
253
24
                   _parent->parent()
254
24
                           ->cast<HashJoinBuildSinkOperatorX>()
255
24
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
24
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
24
                                         _rows, keep_null_key);
262
24
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
24
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
24
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
24
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
24
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
24
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
24
        return Status::OK();
270
24
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi5EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi7EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
24
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
24
        if (null_map) {
221
            // first row is mocked and is null
222
12
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
12
                *has_null_key = true;
224
12
            }
225
12
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
12
        }
229
230
24
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
24
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
24
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
24
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
12
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
12
        }
238
239
24
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
24
                                            null_map ? null_map->data() : nullptr, true, true,
241
24
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
24
        bool keep_null_key = false;
244
24
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
24
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
24
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
24
        } else if (_parent->parent()
250
24
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
24
                                   .is_null_safe_eq_join()
252
24
                                   .size() == 1 &&
253
24
                   _parent->parent()
254
24
                           ->cast<HashJoinBuildSinkOperatorX>()
255
24
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
24
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
24
                                         _rows, keep_null_key);
262
24
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
24
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
24
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
24
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
24
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
24
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
24
        return Status::OK();
270
24
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi9EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
24
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
24
        if (null_map) {
221
            // first row is mocked and is null
222
12
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
12
                *has_null_key = true;
224
12
            }
225
12
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
12
        }
229
230
24
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
24
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
24
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
24
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
12
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
12
        }
238
239
24
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
24
                                            null_map ? null_map->data() : nullptr, true, true,
241
24
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
24
        bool keep_null_key = false;
244
24
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
24
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
24
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
24
        } else if (_parent->parent()
250
24
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
24
                                   .is_null_safe_eq_join()
252
24
                                   .size() == 1 &&
253
24
                   _parent->parent()
254
24
                           ->cast<HashJoinBuildSinkOperatorX>()
255
24
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
24
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
24
                                         _rows, keep_null_key);
262
24
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
24
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
24
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
24
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
24
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
24
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
24
        return Status::OK();
270
24
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi10EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
24
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
24
        if (null_map) {
221
            // first row is mocked and is null
222
24
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
12
                *has_null_key = true;
224
12
            }
225
24
            if (short_circuit_for_null && *has_null_key) {
226
12
                return Status::OK();
227
12
            }
228
24
        }
229
230
12
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
12
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
12
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
12
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
12
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
12
                                            null_map ? null_map->data() : nullptr, true, true,
241
12
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
12
        bool keep_null_key = false;
244
12
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
12
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
12
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
12
        } else if (_parent->parent()
250
12
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
12
                                   .is_null_safe_eq_join()
252
12
                                   .size() == 1 &&
253
12
                   _parent->parent()
254
12
                           ->cast<HashJoinBuildSinkOperatorX>()
255
12
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
12
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
12
                                         _rows, keep_null_key);
262
12
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
12
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
12
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
12
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
12
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
12
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
12
        return Status::OK();
270
24
    }
_ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi11EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
24
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
24
        if (null_map) {
221
            // first row is mocked and is null
222
12
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
12
                *has_null_key = true;
224
12
            }
225
12
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
12
        }
229
230
24
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
24
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
24
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
24
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
12
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
12
        }
238
239
24
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
24
                                            null_map ? null_map->data() : nullptr, true, true,
241
24
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
24
        bool keep_null_key = false;
244
24
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
24
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
24
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
24
        } else if (_parent->parent()
250
24
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
24
                                   .is_null_safe_eq_join()
252
24
                                   .size() == 1 &&
253
24
                   _parent->parent()
254
24
                           ->cast<HashJoinBuildSinkOperatorX>()
255
24
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
24
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
24
                                         _rows, keep_null_key);
262
24
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
24
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
24
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
24
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
24
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
24
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
24
        return Status::OK();
270
24
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi12EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_21MethodOneNumberDirectIN4wide7integerILm128EjEENS_13JoinHashTableIS4_NS_17HashCRC32Return32IS4_EELb1EEEEEE3runILi14EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi0EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
392
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
392
        if (null_map) {
221
            // first row is mocked and is null
222
294
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
294
                *has_null_key = true;
224
294
            }
225
294
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
294
        }
229
230
392
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
392
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
392
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
392
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
392
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
392
                                            null_map ? null_map->data() : nullptr, true, true,
241
392
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
392
        bool keep_null_key = false;
244
392
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
392
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
392
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
392
        } else if (_parent->parent()
250
392
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
392
                                   .is_null_safe_eq_join()
252
392
                                   .size() == 1 &&
253
392
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
392
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
392
                                         _rows, keep_null_key);
262
392
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
392
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
392
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
392
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
392
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
392
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
392
        return Status::OK();
270
392
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi2EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
392
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
392
        if (null_map) {
221
            // first row is mocked and is null
222
294
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
294
                *has_null_key = true;
224
294
            }
225
294
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
294
        }
229
230
392
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
392
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
392
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
392
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
392
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
392
                                            null_map ? null_map->data() : nullptr, true, true,
241
392
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
392
        bool keep_null_key = false;
244
392
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
392
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
392
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
392
        } else if (_parent->parent()
250
392
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
392
                                   .is_null_safe_eq_join()
252
392
                                   .size() == 1 &&
253
392
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
392
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
392
                                         _rows, keep_null_key);
262
392
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
392
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
392
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
392
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
392
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
392
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
392
        return Status::OK();
270
392
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi8EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
392
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
392
        if (null_map) {
221
            // first row is mocked and is null
222
294
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
294
                *has_null_key = true;
224
294
            }
225
294
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
294
        }
229
230
392
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
392
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
392
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
392
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
392
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
392
                                            null_map ? null_map->data() : nullptr, true, true,
241
392
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
392
        bool keep_null_key = false;
244
392
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
392
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
392
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
392
        } else if (_parent->parent()
250
392
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
392
                                   .is_null_safe_eq_join()
252
392
                                   .size() == 1 &&
253
392
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
392
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
392
                                         _rows, keep_null_key);
262
392
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
392
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
392
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
392
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
392
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
392
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
392
        return Status::OK();
270
392
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi1EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
392
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
392
        if (null_map) {
221
            // first row is mocked and is null
222
392
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
294
                *has_null_key = true;
224
294
            }
225
392
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
392
        }
229
230
392
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
392
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
392
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
392
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
392
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
392
                                            null_map ? null_map->data() : nullptr, true, true,
241
392
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
392
        bool keep_null_key = false;
244
392
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
392
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
392
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
392
        } else if (_parent->parent()
250
392
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
392
                                   .is_null_safe_eq_join()
252
392
                                   .size() == 1 &&
253
392
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
392
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
392
                                         _rows, keep_null_key);
262
392
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
392
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
392
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
392
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
392
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
392
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
392
        return Status::OK();
270
392
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi4EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
392
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
392
        if (null_map) {
221
            // first row is mocked and is null
222
392
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
294
                *has_null_key = true;
224
294
            }
225
392
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
392
        }
229
230
392
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
392
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
392
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
392
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
392
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
392
                                            null_map ? null_map->data() : nullptr, true, true,
241
392
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
392
        bool keep_null_key = false;
244
392
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
392
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
392
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
392
        } else if (_parent->parent()
250
392
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
392
                                   .is_null_safe_eq_join()
252
392
                                   .size() == 1 &&
253
392
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
392
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
392
                                         _rows, keep_null_key);
262
392
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
392
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
392
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
392
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
392
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
392
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
392
        return Status::OK();
270
392
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi3EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
392
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
392
        if (null_map) {
221
            // first row is mocked and is null
222
294
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
294
                *has_null_key = true;
224
294
            }
225
294
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
294
        }
229
230
392
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
392
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
392
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
392
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
392
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
392
                                            null_map ? null_map->data() : nullptr, true, true,
241
392
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
392
        bool keep_null_key = false;
244
392
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
392
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
392
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
392
        } else if (_parent->parent()
250
392
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
392
                                   .is_null_safe_eq_join()
252
392
                                   .size() == 1 &&
253
392
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
392
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
392
                                         _rows, keep_null_key);
262
392
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
392
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
392
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
392
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
392
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
392
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
392
        return Status::OK();
270
392
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi5EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi7EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
392
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
392
        if (null_map) {
221
            // first row is mocked and is null
222
294
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
294
                *has_null_key = true;
224
294
            }
225
294
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
294
        }
229
230
392
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
392
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
392
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
392
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
392
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
392
                                            null_map ? null_map->data() : nullptr, true, true,
241
392
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
392
        bool keep_null_key = false;
244
392
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
392
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
392
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
392
        } else if (_parent->parent()
250
392
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
392
                                   .is_null_safe_eq_join()
252
392
                                   .size() == 1 &&
253
392
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
392
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
392
                                         _rows, keep_null_key);
262
392
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
392
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
392
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
392
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
392
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
392
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
392
        return Status::OK();
270
392
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi9EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
392
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
392
        if (null_map) {
221
            // first row is mocked and is null
222
294
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
294
                *has_null_key = true;
224
294
            }
225
294
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
294
        }
229
230
392
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
392
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
392
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
392
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
392
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
392
                                            null_map ? null_map->data() : nullptr, true, true,
241
392
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
392
        bool keep_null_key = false;
244
392
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
392
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
392
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
392
        } else if (_parent->parent()
250
392
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
392
                                   .is_null_safe_eq_join()
252
392
                                   .size() == 1 &&
253
392
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
392
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
392
                                         _rows, keep_null_key);
262
392
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
392
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
392
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
392
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
392
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
392
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
392
        return Status::OK();
270
392
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi10EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
392
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
392
        if (null_map) {
221
            // first row is mocked and is null
222
392
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
294
                *has_null_key = true;
224
294
            }
225
392
            if (short_circuit_for_null && *has_null_key) {
226
294
                return Status::OK();
227
294
            }
228
392
        }
229
230
98
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
98
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
98
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
98
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
98
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
98
                                            null_map ? null_map->data() : nullptr, true, true,
241
98
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
98
        bool keep_null_key = false;
244
98
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
98
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
98
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
98
        } else if (_parent->parent()
250
98
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
98
                                   .is_null_safe_eq_join()
252
98
                                   .size() == 1 &&
253
98
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
98
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
98
                                         _rows, keep_null_key);
262
98
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
98
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
98
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
98
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
98
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
98
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
98
        return Status::OK();
270
392
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi11EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
392
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
392
        if (null_map) {
221
            // first row is mocked and is null
222
294
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
294
                *has_null_key = true;
224
294
            }
225
294
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
294
        }
229
230
392
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
392
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
392
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
392
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
392
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
392
                                            null_map ? null_map->data() : nullptr, true, true,
241
392
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
392
        bool keep_null_key = false;
244
392
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
392
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
392
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
392
        } else if (_parent->parent()
250
392
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
392
                                   .is_null_safe_eq_join()
252
392
                                   .size() == 1 &&
253
392
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
392
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
392
                                         _rows, keep_null_key);
262
392
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
392
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
392
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
392
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
392
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
392
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
392
        return Status::OK();
270
392
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi12EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableImNS_17HashCRC32Return32ImEELb0EEEEEE3runILi14EEENS_6StatusERS6_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi0EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
320
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
320
        if (null_map) {
221
            // first row is mocked and is null
222
240
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
240
                *has_null_key = true;
224
240
            }
225
240
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
240
        }
229
230
320
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
320
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
320
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
320
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
320
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
320
                                            null_map ? null_map->data() : nullptr, true, true,
241
320
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
320
        bool keep_null_key = false;
244
320
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
320
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
320
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
320
        } else if (_parent->parent()
250
320
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
320
                                   .is_null_safe_eq_join()
252
320
                                   .size() == 1 &&
253
320
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
320
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
320
                                         _rows, keep_null_key);
262
320
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
320
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
320
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
320
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
320
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
320
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
320
        return Status::OK();
270
320
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi2EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
320
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
320
        if (null_map) {
221
            // first row is mocked and is null
222
240
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
240
                *has_null_key = true;
224
240
            }
225
240
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
240
        }
229
230
320
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
320
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
320
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
320
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
320
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
320
                                            null_map ? null_map->data() : nullptr, true, true,
241
320
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
320
        bool keep_null_key = false;
244
320
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
320
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
320
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
320
        } else if (_parent->parent()
250
320
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
320
                                   .is_null_safe_eq_join()
252
320
                                   .size() == 1 &&
253
320
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
320
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
320
                                         _rows, keep_null_key);
262
320
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
320
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
320
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
320
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
320
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
320
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
320
        return Status::OK();
270
320
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi8EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
320
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
320
        if (null_map) {
221
            // first row is mocked and is null
222
240
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
240
                *has_null_key = true;
224
240
            }
225
240
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
240
        }
229
230
320
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
320
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
320
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
320
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
320
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
320
                                            null_map ? null_map->data() : nullptr, true, true,
241
320
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
320
        bool keep_null_key = false;
244
320
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
320
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
320
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
320
        } else if (_parent->parent()
250
320
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
320
                                   .is_null_safe_eq_join()
252
320
                                   .size() == 1 &&
253
320
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
320
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
320
                                         _rows, keep_null_key);
262
320
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
320
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
320
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
320
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
320
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
320
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
320
        return Status::OK();
270
320
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi1EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
320
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
320
        if (null_map) {
221
            // first row is mocked and is null
222
320
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
240
                *has_null_key = true;
224
240
            }
225
320
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
320
        }
229
230
320
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
320
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
320
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
320
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
320
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
320
                                            null_map ? null_map->data() : nullptr, true, true,
241
320
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
320
        bool keep_null_key = false;
244
320
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
320
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
320
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
320
        } else if (_parent->parent()
250
320
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
320
                                   .is_null_safe_eq_join()
252
320
                                   .size() == 1 &&
253
320
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
320
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
320
                                         _rows, keep_null_key);
262
320
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
320
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
320
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
320
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
320
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
320
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
320
        return Status::OK();
270
320
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi4EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
320
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
320
        if (null_map) {
221
            // first row is mocked and is null
222
320
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
240
                *has_null_key = true;
224
240
            }
225
320
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
320
        }
229
230
320
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
320
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
320
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
320
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
320
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
320
                                            null_map ? null_map->data() : nullptr, true, true,
241
320
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
320
        bool keep_null_key = false;
244
320
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
320
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
320
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
320
        } else if (_parent->parent()
250
320
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
320
                                   .is_null_safe_eq_join()
252
320
                                   .size() == 1 &&
253
320
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
320
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
320
                                         _rows, keep_null_key);
262
320
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
320
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
320
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
320
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
320
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
320
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
320
        return Status::OK();
270
320
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi3EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
320
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
320
        if (null_map) {
221
            // first row is mocked and is null
222
240
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
240
                *has_null_key = true;
224
240
            }
225
240
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
240
        }
229
230
320
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
320
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
320
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
320
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
320
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
320
                                            null_map ? null_map->data() : nullptr, true, true,
241
320
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
320
        bool keep_null_key = false;
244
320
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
320
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
320
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
320
        } else if (_parent->parent()
250
320
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
320
                                   .is_null_safe_eq_join()
252
320
                                   .size() == 1 &&
253
320
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
320
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
320
                                         _rows, keep_null_key);
262
320
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
320
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
320
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
320
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
320
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
320
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
320
        return Status::OK();
270
320
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi5EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi7EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
320
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
320
        if (null_map) {
221
            // first row is mocked and is null
222
240
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
240
                *has_null_key = true;
224
240
            }
225
240
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
240
        }
229
230
320
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
320
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
320
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
320
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
320
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
320
                                            null_map ? null_map->data() : nullptr, true, true,
241
320
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
320
        bool keep_null_key = false;
244
320
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
320
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
320
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
320
        } else if (_parent->parent()
250
320
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
320
                                   .is_null_safe_eq_join()
252
320
                                   .size() == 1 &&
253
320
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
320
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
320
                                         _rows, keep_null_key);
262
320
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
320
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
320
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
320
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
320
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
320
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
320
        return Status::OK();
270
320
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi9EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
320
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
320
        if (null_map) {
221
            // first row is mocked and is null
222
240
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
240
                *has_null_key = true;
224
240
            }
225
240
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
240
        }
229
230
320
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
320
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
320
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
320
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
320
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
320
                                            null_map ? null_map->data() : nullptr, true, true,
241
320
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
320
        bool keep_null_key = false;
244
320
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
320
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
320
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
320
        } else if (_parent->parent()
250
320
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
320
                                   .is_null_safe_eq_join()
252
320
                                   .size() == 1 &&
253
320
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
320
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
320
                                         _rows, keep_null_key);
262
320
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
320
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
320
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
320
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
320
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
320
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
320
        return Status::OK();
270
320
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi10EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
320
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
320
        if (null_map) {
221
            // first row is mocked and is null
222
320
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
240
                *has_null_key = true;
224
240
            }
225
320
            if (short_circuit_for_null && *has_null_key) {
226
240
                return Status::OK();
227
240
            }
228
320
        }
229
230
80
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
80
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
80
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
80
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
80
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
80
                                            null_map ? null_map->data() : nullptr, true, true,
241
80
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
80
        bool keep_null_key = false;
244
80
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
80
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
80
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
80
        } else if (_parent->parent()
250
80
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
80
                                   .is_null_safe_eq_join()
252
80
                                   .size() == 1 &&
253
80
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
80
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
80
                                         _rows, keep_null_key);
262
80
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
80
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
80
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
80
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
80
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
80
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
80
        return Status::OK();
270
320
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi11EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
320
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
320
        if (null_map) {
221
            // first row is mocked and is null
222
240
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
240
                *has_null_key = true;
224
240
            }
225
240
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
240
        }
229
230
320
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
320
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
320
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
320
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
320
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
320
                                            null_map ? null_map->data() : nullptr, true, true,
241
320
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
320
        bool keep_null_key = false;
244
320
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
320
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
320
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
320
        } else if (_parent->parent()
250
320
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
320
                                   .is_null_safe_eq_join()
252
320
                                   .size() == 1 &&
253
320
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
320
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
320
                                         _rows, keep_null_key);
262
320
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
320
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
320
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
320
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
320
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
320
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
320
        return Status::OK();
270
320
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi12EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt72ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi14EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi0EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi2EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi8EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi1EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
800
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
800
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
800
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi4EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
800
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
800
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
800
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi3EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi5EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi7EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi9EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi10EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
800
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
800
            if (short_circuit_for_null && *has_null_key) {
226
600
                return Status::OK();
227
600
            }
228
800
        }
229
230
200
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
200
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
200
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
200
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
200
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
200
                                            null_map ? null_map->data() : nullptr, true, true,
241
200
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
200
        bool keep_null_key = false;
244
200
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
200
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
200
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
200
        } else if (_parent->parent()
250
200
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
200
                                   .is_null_safe_eq_join()
252
200
                                   .size() == 1 &&
253
200
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
200
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
200
                                         _rows, keep_null_key);
262
200
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
200
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
200
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
200
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
200
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
200
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
200
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi11EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi12EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_6UInt96ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi14EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi0EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi2EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi8EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi1EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi4EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi3EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi5EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi7EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi9EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi10EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi11EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi12EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt104ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi14EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi0EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi2EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi8EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi1EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
800
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
800
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
800
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi4EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
800
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
800
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
800
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi3EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi5EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi7EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi9EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi10EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
800
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
800
            if (short_circuit_for_null && *has_null_key) {
226
600
                return Status::OK();
227
600
            }
228
800
        }
229
230
200
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
200
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
200
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
200
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
200
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
200
                                            null_map ? null_map->data() : nullptr, true, true,
241
200
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
200
        bool keep_null_key = false;
244
200
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
200
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
200
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
200
        } else if (_parent->parent()
250
200
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
200
                                   .is_null_safe_eq_join()
252
200
                                   .size() == 1 &&
253
200
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
200
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
200
                                         _rows, keep_null_key);
262
200
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
200
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
200
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
200
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
200
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
200
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
200
        return Status::OK();
270
800
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi11EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
800
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
800
        if (null_map) {
221
            // first row is mocked and is null
222
600
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
600
                *has_null_key = true;
224
600
            }
225
600
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
600
        }
229
230
800
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
800
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
800
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
800
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
800
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
800
                                            null_map ? null_map->data() : nullptr, true, true,
241
800
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
800
        bool keep_null_key = false;
244
800
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
800
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
800
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
800
        } else if (_parent->parent()
250
800
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
800
                                   .is_null_safe_eq_join()
252
800
                                   .size() == 1 &&
253
800
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
800
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
800
                                         _rows, keep_null_key);
262
800
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
800
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
800
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
800
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
800
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
800
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
800
        return Status::OK();
270
800
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi12EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm128EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi14EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi0EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
96
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
96
        if (null_map) {
221
            // first row is mocked and is null
222
72
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
72
                *has_null_key = true;
224
72
            }
225
72
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
72
        }
229
230
96
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
96
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
96
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
96
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
96
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
96
                                            null_map ? null_map->data() : nullptr, true, true,
241
96
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
96
        bool keep_null_key = false;
244
96
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
96
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
96
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
96
        } else if (_parent->parent()
250
96
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
96
                                   .is_null_safe_eq_join()
252
96
                                   .size() == 1 &&
253
96
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
96
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
96
                                         _rows, keep_null_key);
262
96
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
96
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
96
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
96
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
96
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
96
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
96
        return Status::OK();
270
96
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi2EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
96
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
96
        if (null_map) {
221
            // first row is mocked and is null
222
72
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
72
                *has_null_key = true;
224
72
            }
225
72
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
72
        }
229
230
96
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
96
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
96
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
96
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
96
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
96
                                            null_map ? null_map->data() : nullptr, true, true,
241
96
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
96
        bool keep_null_key = false;
244
96
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
96
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
96
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
96
        } else if (_parent->parent()
250
96
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
96
                                   .is_null_safe_eq_join()
252
96
                                   .size() == 1 &&
253
96
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
96
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
96
                                         _rows, keep_null_key);
262
96
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
96
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
96
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
96
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
96
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
96
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
96
        return Status::OK();
270
96
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi8EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
96
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
96
        if (null_map) {
221
            // first row is mocked and is null
222
72
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
72
                *has_null_key = true;
224
72
            }
225
72
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
72
        }
229
230
96
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
96
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
96
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
96
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
96
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
96
                                            null_map ? null_map->data() : nullptr, true, true,
241
96
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
96
        bool keep_null_key = false;
244
96
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
96
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
96
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
96
        } else if (_parent->parent()
250
96
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
96
                                   .is_null_safe_eq_join()
252
96
                                   .size() == 1 &&
253
96
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
96
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
96
                                         _rows, keep_null_key);
262
96
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
96
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
96
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
96
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
96
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
96
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
96
        return Status::OK();
270
96
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi1EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
96
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
96
        if (null_map) {
221
            // first row is mocked and is null
222
96
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
72
                *has_null_key = true;
224
72
            }
225
96
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
96
        }
229
230
96
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
96
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
96
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
96
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
96
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
96
                                            null_map ? null_map->data() : nullptr, true, true,
241
96
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
96
        bool keep_null_key = false;
244
96
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
96
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
96
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
96
        } else if (_parent->parent()
250
96
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
96
                                   .is_null_safe_eq_join()
252
96
                                   .size() == 1 &&
253
96
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
96
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
96
                                         _rows, keep_null_key);
262
96
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
96
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
96
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
96
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
96
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
96
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
96
        return Status::OK();
270
96
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi4EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
96
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
96
        if (null_map) {
221
            // first row is mocked and is null
222
96
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
72
                *has_null_key = true;
224
72
            }
225
96
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
96
        }
229
230
96
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
96
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
96
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
96
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
96
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
96
                                            null_map ? null_map->data() : nullptr, true, true,
241
96
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
96
        bool keep_null_key = false;
244
96
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
96
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
96
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
96
        } else if (_parent->parent()
250
96
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
96
                                   .is_null_safe_eq_join()
252
96
                                   .size() == 1 &&
253
96
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
96
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
96
                                         _rows, keep_null_key);
262
96
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
96
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
96
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
96
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
96
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
96
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
96
        return Status::OK();
270
96
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi3EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
96
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
96
        if (null_map) {
221
            // first row is mocked and is null
222
72
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
72
                *has_null_key = true;
224
72
            }
225
72
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
72
        }
229
230
96
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
96
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
96
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
96
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
96
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
96
                                            null_map ? null_map->data() : nullptr, true, true,
241
96
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
96
        bool keep_null_key = false;
244
96
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
96
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
96
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
96
        } else if (_parent->parent()
250
96
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
96
                                   .is_null_safe_eq_join()
252
96
                                   .size() == 1 &&
253
96
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
96
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
96
                                         _rows, keep_null_key);
262
96
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
96
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
96
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
96
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
96
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
96
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
96
        return Status::OK();
270
96
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi5EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi7EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
96
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
96
        if (null_map) {
221
            // first row is mocked and is null
222
72
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
72
                *has_null_key = true;
224
72
            }
225
72
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
72
        }
229
230
96
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
96
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
96
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
96
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
96
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
96
                                            null_map ? null_map->data() : nullptr, true, true,
241
96
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
96
        bool keep_null_key = false;
244
96
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
96
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
96
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
96
        } else if (_parent->parent()
250
96
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
96
                                   .is_null_safe_eq_join()
252
96
                                   .size() == 1 &&
253
96
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
96
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
96
                                         _rows, keep_null_key);
262
96
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
96
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
96
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
96
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
96
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
96
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
96
        return Status::OK();
270
96
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi9EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
96
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
96
        if (null_map) {
221
            // first row is mocked and is null
222
72
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
72
                *has_null_key = true;
224
72
            }
225
72
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
72
        }
229
230
96
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
96
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
96
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
96
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
96
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
96
                                            null_map ? null_map->data() : nullptr, true, true,
241
96
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
96
        bool keep_null_key = false;
244
96
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
96
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
96
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
96
        } else if (_parent->parent()
250
96
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
96
                                   .is_null_safe_eq_join()
252
96
                                   .size() == 1 &&
253
96
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
96
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
96
                                         _rows, keep_null_key);
262
96
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
96
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
96
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
96
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
96
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
96
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
96
        return Status::OK();
270
96
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi10EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
96
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
96
        if (null_map) {
221
            // first row is mocked and is null
222
96
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
72
                *has_null_key = true;
224
72
            }
225
96
            if (short_circuit_for_null && *has_null_key) {
226
72
                return Status::OK();
227
72
            }
228
96
        }
229
230
24
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
24
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
24
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
24
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
24
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
24
                                            null_map ? null_map->data() : nullptr, true, true,
241
24
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
24
        bool keep_null_key = false;
244
24
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
24
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
24
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
24
        } else if (_parent->parent()
250
24
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
24
                                   .is_null_safe_eq_join()
252
24
                                   .size() == 1 &&
253
24
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
24
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
24
                                         _rows, keep_null_key);
262
24
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
24
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
24
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
24
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
24
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
24
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
24
        return Status::OK();
270
96
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi11EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
96
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
96
        if (null_map) {
221
            // first row is mocked and is null
222
72
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
72
                *has_null_key = true;
224
72
            }
225
72
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
72
        }
229
230
96
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
96
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
96
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
96
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
96
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
96
                                            null_map ? null_map->data() : nullptr, true, true,
241
96
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
96
        bool keep_null_key = false;
244
96
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
96
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
96
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
96
        } else if (_parent->parent()
250
96
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
96
                                   .is_null_safe_eq_join()
252
96
                                   .size() == 1 &&
253
96
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
96
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
96
                                         _rows, keep_null_key);
262
96
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
96
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
96
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
96
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
96
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
96
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
96
        return Status::OK();
270
96
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi12EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableINS_7UInt136ENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi14EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi0EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
792
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
792
        if (null_map) {
221
            // first row is mocked and is null
222
594
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
594
                *has_null_key = true;
224
594
            }
225
594
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
594
        }
229
230
792
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
792
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
792
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
792
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
792
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
792
                                            null_map ? null_map->data() : nullptr, true, true,
241
792
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
792
        bool keep_null_key = false;
244
792
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
792
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
792
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
792
        } else if (_parent->parent()
250
792
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
792
                                   .is_null_safe_eq_join()
252
792
                                   .size() == 1 &&
253
792
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
792
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
792
                                         _rows, keep_null_key);
262
792
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
792
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
792
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
792
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
792
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
792
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
792
        return Status::OK();
270
792
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi2EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
792
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
792
        if (null_map) {
221
            // first row is mocked and is null
222
594
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
594
                *has_null_key = true;
224
594
            }
225
594
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
594
        }
229
230
792
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
792
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
792
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
792
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
792
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
792
                                            null_map ? null_map->data() : nullptr, true, true,
241
792
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
792
        bool keep_null_key = false;
244
792
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
792
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
792
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
792
        } else if (_parent->parent()
250
792
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
792
                                   .is_null_safe_eq_join()
252
792
                                   .size() == 1 &&
253
792
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
792
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
792
                                         _rows, keep_null_key);
262
792
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
792
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
792
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
792
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
792
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
792
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
792
        return Status::OK();
270
792
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi8EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
792
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
792
        if (null_map) {
221
            // first row is mocked and is null
222
594
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
594
                *has_null_key = true;
224
594
            }
225
594
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
594
        }
229
230
792
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
792
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
792
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
792
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
792
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
792
                                            null_map ? null_map->data() : nullptr, true, true,
241
792
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
792
        bool keep_null_key = false;
244
792
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
792
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
792
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
792
        } else if (_parent->parent()
250
792
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
792
                                   .is_null_safe_eq_join()
252
792
                                   .size() == 1 &&
253
792
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
792
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
792
                                         _rows, keep_null_key);
262
792
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
792
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
792
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
792
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
792
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
792
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
792
        return Status::OK();
270
792
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi1EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
792
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
792
        if (null_map) {
221
            // first row is mocked and is null
222
792
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
594
                *has_null_key = true;
224
594
            }
225
792
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
792
        }
229
230
792
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
792
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
792
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
792
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
792
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
792
                                            null_map ? null_map->data() : nullptr, true, true,
241
792
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
792
        bool keep_null_key = false;
244
792
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
792
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
792
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
792
        } else if (_parent->parent()
250
792
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
792
                                   .is_null_safe_eq_join()
252
792
                                   .size() == 1 &&
253
792
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
792
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
792
                                         _rows, keep_null_key);
262
792
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
792
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
792
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
792
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
792
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
792
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
792
        return Status::OK();
270
792
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi4EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
792
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
792
        if (null_map) {
221
            // first row is mocked and is null
222
792
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
594
                *has_null_key = true;
224
594
            }
225
792
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
792
        }
229
230
792
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
792
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
792
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
792
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
792
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
792
                                            null_map ? null_map->data() : nullptr, true, true,
241
792
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
792
        bool keep_null_key = false;
244
792
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
792
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
792
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
792
        } else if (_parent->parent()
250
792
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
792
                                   .is_null_safe_eq_join()
252
792
                                   .size() == 1 &&
253
792
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
792
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
792
                                         _rows, keep_null_key);
262
792
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
792
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
792
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
792
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
792
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
792
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
792
        return Status::OK();
270
792
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi3EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
792
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
792
        if (null_map) {
221
            // first row is mocked and is null
222
594
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
594
                *has_null_key = true;
224
594
            }
225
594
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
594
        }
229
230
792
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
792
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
792
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
792
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
792
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
792
                                            null_map ? null_map->data() : nullptr, true, true,
241
792
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
792
        bool keep_null_key = false;
244
792
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
792
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
792
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
792
        } else if (_parent->parent()
250
792
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
792
                                   .is_null_safe_eq_join()
252
792
                                   .size() == 1 &&
253
792
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
792
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
792
                                         _rows, keep_null_key);
262
792
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
792
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
792
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
792
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
792
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
792
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
792
        return Status::OK();
270
792
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi5EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi7EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
792
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
792
        if (null_map) {
221
            // first row is mocked and is null
222
594
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
594
                *has_null_key = true;
224
594
            }
225
594
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
594
        }
229
230
792
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
792
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
792
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
792
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
792
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
792
                                            null_map ? null_map->data() : nullptr, true, true,
241
792
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
792
        bool keep_null_key = false;
244
792
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
792
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
792
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
792
        } else if (_parent->parent()
250
792
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
792
                                   .is_null_safe_eq_join()
252
792
                                   .size() == 1 &&
253
792
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
792
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
792
                                         _rows, keep_null_key);
262
792
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
792
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
792
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
792
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
792
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
792
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
792
        return Status::OK();
270
792
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi9EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
792
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
792
        if (null_map) {
221
            // first row is mocked and is null
222
594
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
594
                *has_null_key = true;
224
594
            }
225
594
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
594
        }
229
230
792
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
792
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
792
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
792
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
792
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
792
                                            null_map ? null_map->data() : nullptr, true, true,
241
792
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
792
        bool keep_null_key = false;
244
792
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
792
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
792
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
792
        } else if (_parent->parent()
250
792
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
792
                                   .is_null_safe_eq_join()
252
792
                                   .size() == 1 &&
253
792
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
792
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
792
                                         _rows, keep_null_key);
262
792
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
792
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
792
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
792
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
792
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
792
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
792
        return Status::OK();
270
792
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi10EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
792
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
792
        if (null_map) {
221
            // first row is mocked and is null
222
792
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
594
                *has_null_key = true;
224
594
            }
225
792
            if (short_circuit_for_null && *has_null_key) {
226
594
                return Status::OK();
227
594
            }
228
792
        }
229
230
198
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
198
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
198
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
198
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
198
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
198
                                            null_map ? null_map->data() : nullptr, true, true,
241
198
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
198
        bool keep_null_key = false;
244
198
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
198
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
198
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
198
        } else if (_parent->parent()
250
198
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
198
                                   .is_null_safe_eq_join()
252
198
                                   .size() == 1 &&
253
198
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
198
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
198
                                         _rows, keep_null_key);
262
198
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
198
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
198
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
198
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
198
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
198
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
198
        return Status::OK();
270
792
    }
_ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi11EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
792
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
792
        if (null_map) {
221
            // first row is mocked and is null
222
594
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
594
                *has_null_key = true;
224
594
            }
225
594
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
594
        }
229
230
792
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
792
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
792
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
792
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
792
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
792
                                            null_map ? null_map->data() : nullptr, true, true,
241
792
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
792
        bool keep_null_key = false;
244
792
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
792
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
792
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
792
        } else if (_parent->parent()
250
792
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
792
                                   .is_null_safe_eq_join()
252
792
                                   .size() == 1 &&
253
792
                   _parent->parent()
254
0
                           ->cast<HashJoinBuildSinkOperatorX>()
255
0
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
792
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
792
                                         _rows, keep_null_key);
262
792
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
792
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
792
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
792
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
792
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
792
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
792
        return Status::OK();
270
792
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi12EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_15MethodKeysFixedINS_13JoinHashTableIN4wide7integerILm256EjEENS_17HashCRC32Return32IS5_EELb0EEEEEE3runILi14EEENS_6StatusERS9_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi0EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi2EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
33
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
33
        if (null_map) {
221
            // first row is mocked and is null
222
17
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
17
                *has_null_key = true;
224
17
            }
225
17
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
17
        }
229
230
33
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
33
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
33
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
33
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
17
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
17
        }
238
239
33
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
33
                                            null_map ? null_map->data() : nullptr, true, true,
241
33
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
33
        bool keep_null_key = false;
244
33
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
33
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
33
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
33
        } else if (_parent->parent()
250
33
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
33
                                   .is_null_safe_eq_join()
252
33
                                   .size() == 1 &&
253
33
                   _parent->parent()
254
33
                           ->cast<HashJoinBuildSinkOperatorX>()
255
33
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
33
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
33
                                         _rows, keep_null_key);
262
33
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
33
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
33
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
33
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
33
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
33
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
33
        return Status::OK();
270
33
    }
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi8EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
34
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
34
        if (null_map) {
221
            // first row is mocked and is null
222
18
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
18
                *has_null_key = true;
224
18
            }
225
18
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
18
        }
229
230
34
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
34
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
34
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
34
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
18
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
18
        }
238
239
34
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
34
                                            null_map ? null_map->data() : nullptr, true, true,
241
34
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
34
        bool keep_null_key = false;
244
34
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
34
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
34
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
34
        } else if (_parent->parent()
250
34
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
34
                                   .is_null_safe_eq_join()
252
34
                                   .size() == 1 &&
253
34
                   _parent->parent()
254
34
                           ->cast<HashJoinBuildSinkOperatorX>()
255
34
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
34
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
34
                                         _rows, keep_null_key);
262
34
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
34
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
34
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
34
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
34
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
34
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
34
        return Status::OK();
270
34
    }
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi1EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
32
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
32
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
32
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi4EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
32
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
32
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
32
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi3EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi5EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi7EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
33
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
33
        if (null_map) {
221
            // first row is mocked and is null
222
17
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
17
                *has_null_key = true;
224
17
            }
225
17
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
17
        }
229
230
33
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
33
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
33
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
33
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
17
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
17
        }
238
239
33
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
33
                                            null_map ? null_map->data() : nullptr, true, true,
241
33
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
33
        bool keep_null_key = false;
244
33
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
33
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
33
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
33
        } else if (_parent->parent()
250
33
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
33
                                   .is_null_safe_eq_join()
252
33
                                   .size() == 1 &&
253
33
                   _parent->parent()
254
33
                           ->cast<HashJoinBuildSinkOperatorX>()
255
33
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
33
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
33
                                         _rows, keep_null_key);
262
33
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
33
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
33
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
33
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
33
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
33
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
33
        return Status::OK();
270
33
    }
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi9EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi10EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
32
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
32
            if (short_circuit_for_null && *has_null_key) {
226
16
                return Status::OK();
227
16
            }
228
32
        }
229
230
16
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
16
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
16
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
16
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
0
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
0
        }
238
239
16
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
16
                                            null_map ? null_map->data() : nullptr, true, true,
241
16
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
16
        bool keep_null_key = false;
244
16
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
16
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
16
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
16
        } else if (_parent->parent()
250
16
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
16
                                   .is_null_safe_eq_join()
252
16
                                   .size() == 1 &&
253
16
                   _parent->parent()
254
16
                           ->cast<HashJoinBuildSinkOperatorX>()
255
16
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
16
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
16
                                         _rows, keep_null_key);
262
16
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
16
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
16
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
16
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
16
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
16
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
16
        return Status::OK();
270
32
    }
_ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi11EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Line
Count
Source
219
32
               bool short_circuit_for_null, bool with_other_conjuncts) {
220
32
        if (null_map) {
221
            // first row is mocked and is null
222
16
            if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
223
16
                *has_null_key = true;
224
16
            }
225
16
            if (short_circuit_for_null && *has_null_key) {
226
0
                return Status::OK();
227
0
            }
228
16
        }
229
230
32
        SCOPED_TIMER(_parent->_build_table_insert_timer);
231
32
        hash_table_ctx.hash_table->template prepare_build<JoinOpType>(
232
32
                _rows, _batch_size, *has_null_key, hash_table_ctx.direct_mapping_range());
233
234
        // In order to make the null keys equal when using single null eq, all null keys need to be set to default value.
235
32
        if (_build_raw_ptrs.size() == 1 && null_map && *has_null_key) {
236
16
            _build_raw_ptrs[0]->assume_mutable()->replace_column_null_data(null_map->data());
237
16
        }
238
239
32
        hash_table_ctx.init_serialized_keys(_build_raw_ptrs, _rows,
240
32
                                            null_map ? null_map->data() : nullptr, true, true,
241
32
                                            hash_table_ctx.hash_table->get_bucket_size());
242
        // only 2 cases need to access the null value in hash table
243
32
        bool keep_null_key = false;
244
32
        if ((JoinOpType == TJoinOp::NULL_AWARE_LEFT_ANTI_JOIN ||
245
32
             JoinOpType == TJoinOp::NULL_AWARE_LEFT_SEMI_JOIN) &&
246
32
            with_other_conjuncts) {
247
            // null aware join with other conjuncts
248
0
            keep_null_key = true;
249
32
        } else if (_parent->parent()
250
32
                                   ->cast<HashJoinBuildSinkOperatorX>()
251
32
                                   .is_null_safe_eq_join()
252
32
                                   .size() == 1 &&
253
32
                   _parent->parent()
254
32
                           ->cast<HashJoinBuildSinkOperatorX>()
255
32
                           .is_null_safe_eq_join()[0]) {
256
            // single null safe eq
257
0
            keep_null_key = true;
258
0
        }
259
260
32
        hash_table_ctx.hash_table->build(hash_table_ctx.keys, hash_table_ctx.bucket_nums.data(),
261
32
                                         _rows, keep_null_key);
262
32
        hash_table_ctx.bucket_nums.resize(_batch_size);
263
32
        hash_table_ctx.bucket_nums.shrink_to_fit();
264
265
32
        COUNTER_SET(_parent->_hash_table_memory_usage,
266
32
                    (int64_t)hash_table_ctx.hash_table->get_byte_size());
267
32
        COUNTER_SET(_parent->_build_arena_memory_usage,
268
32
                    (int64_t)hash_table_ctx.serialized_keys_size(true));
269
32
        return Status::OK();
270
32
    }
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi12EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
Unexecuted instantiation: _ZN5doris21ProcessHashTableBuildINS_19MethodStringNoCacheINS_13JoinHashTableINS_9StringRefENS_17HashCRC32Return32IS3_EELb0EEEEEE3runILi14EEENS_6StatusERS7_PKNS_8PODArrayIhLm4096ENS_9AllocatorILb0ELb0ELb0ENS_22DefaultMemoryAllocatorELb1EEELm16ELm15EEEPbbb
271
272
private:
273
    const uint32_t _rows;
274
    ColumnRawPtrs& _build_raw_ptrs;
275
    HashJoinBuildSinkLocalState* _parent = nullptr;
276
    int _batch_size;
277
    RuntimeState* _state = nullptr;
278
};
279
280
} // namespace doris