Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions be/src/exec/operator/hashjoin_build_sink.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -590,32 +590,27 @@ Status HashJoinBuildSinkLocalState::process_build_block(RuntimeState* state, Blo
RETURN_IF_ERROR(_hash_table_init(state, raw_ptrs));

Status st = std::visit(
Overload {[&](std::monostate& arg, auto join_op,
auto short_circuit_for_null_in_build_side,
auto with_other_conjuncts) -> Status {
Overload {[&](std::monostate& arg, auto join_op) -> Status {
throw Exception(Status::FatalError("FATAL: uninited hash table"));
},
[&](auto&& arg, auto&& join_op, auto short_circuit_for_null_in_build_side,
auto with_other_conjuncts) -> Status {
[&](auto&& arg, auto&& join_op) -> Status {
using HashTableCtxType = std::decay_t<decltype(arg)>;
using JoinOpType = std::decay_t<decltype(join_op)>;
ProcessHashTableBuild<HashTableCtxType> hash_table_build_process(
rows, raw_ptrs, this, state->batch_size(), state);
auto st = hash_table_build_process.template run<
JoinOpType::value, short_circuit_for_null_in_build_side,
with_other_conjuncts>(
auto st = hash_table_build_process.template run<JoinOpType::value>(
arg, null_map_val ? &null_map_val->get_data() : nullptr,
&_shared_state->_has_null_in_build_side);
&_shared_state->_has_null_in_build_side,
p._short_circuit_for_null_in_build_side,
p._have_other_join_conjunct);
COUNTER_SET(_memory_used_counter,
_build_blocks_memory_usage->value() +
(int64_t)(arg.hash_table->get_byte_size() +
arg.serialized_keys_size(true)));
return st;
}},
_shared_state->hash_table_variant_vector.front()->method_variant,
_shared_state->join_op_variants,
make_bool_variant(p._short_circuit_for_null_in_build_side),
make_bool_variant((p._have_other_join_conjunct)));
_shared_state->join_op_variants);
return st;
}

Expand Down
5 changes: 3 additions & 2 deletions be/src/exec/operator/hashjoin_build_sink.h
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,9 @@ struct ProcessHashTableBuild {
_batch_size(batch_size),
_state(state) {}

template <int JoinOpType, bool short_circuit_for_null, bool with_other_conjuncts>
Status run(HashTableContext& hash_table_ctx, ConstNullMapPtr null_map, bool* has_null_key) {
template <int JoinOpType>
Status run(HashTableContext& hash_table_ctx, ConstNullMapPtr null_map, bool* has_null_key,
bool short_circuit_for_null, bool with_other_conjuncts) {
if (null_map) {
// first row is mocked and is null
if (simd::contain_one(null_map->data() + 1, _rows - 1)) {
Expand Down
Loading