diff --git a/be/src/exec/hash_join_components.cpp b/be/src/exec/hash_join_components.cpp index 86991a632c105..dce66eb6ac357 100644 --- a/be/src/exec/hash_join_components.cpp +++ b/be/src/exec/hash_join_components.cpp @@ -627,7 +627,7 @@ int64_t AdaptivePartitionHashJoinBuilder::ht_mem_usage() const { Status AdaptivePartitionHashJoinBuilder::_convert_to_single_partition() { // merge all partition data to the first partition - for (size_t i = 1; i < _partition_num; ++i) { + for (size_t i = 1; i < _builders.size(); ++i) { _builders[0]->hash_table().merge_ht(_builders[i]->hash_table()); } _builders.resize(1); diff --git a/be/src/exec/pipeline/hashjoin/spillable_hash_join_build_operator.cpp b/be/src/exec/pipeline/hashjoin/spillable_hash_join_build_operator.cpp index 3c0166e292d2f..4a628ecc2252c 100644 --- a/be/src/exec/pipeline/hashjoin/spillable_hash_join_build_operator.cpp +++ b/be/src/exec/pipeline/hashjoin/spillable_hash_join_build_operator.cpp @@ -249,13 +249,18 @@ StatusOr()>> SpillableHashJoinBuildOperator::_c return [this]() -> StatusOr { if (_hash_table_build_chunk_slice.empty()) { - if (_hash_table_iterate_idx + 1 >= _hash_tables.size()) { + _hash_table_iterate_idx++; + for (; _hash_table_iterate_idx < _hash_tables.size(); _hash_table_iterate_idx++) { + auto build_chunk = _hash_tables[_hash_table_iterate_idx]->get_build_chunk(); + if (build_chunk->num_rows() > 0) { + _hash_table_build_chunk_slice.reset(build_chunk); + _hash_table_build_chunk_slice.skip(kHashJoinKeyColumnOffset); + break; + } + } + if (_hash_table_build_chunk_slice.empty()) { _join_builder->hash_join_builder()->reset(_join_builder->hash_table_param()); return Status::EndOfFile("eos"); - } else { - _hash_table_iterate_idx++; - _hash_table_build_chunk_slice.reset(_hash_tables[_hash_table_iterate_idx]->get_build_chunk()); - _hash_table_build_chunk_slice.skip(kHashJoinKeyColumnOffset); } } diff --git a/be/src/types/logical_type_infra.h b/be/src/types/logical_type_infra.h index b05f8cbca9c61..4942819970d9d 100644 --- a/be/src/types/logical_type_infra.h +++ b/be/src/types/logical_type_infra.h @@ -149,6 +149,8 @@ auto type_dispatch_all(LogicalType ltype, Functor fun, Args... args) { switch (ltype) { APPLY_FOR_ALL_SCALAR_TYPE_WITH_NULL(_TYPE_DISPATCH_CASE) _TYPE_DISPATCH_CASE(TYPE_ARRAY) + _TYPE_DISPATCH_CASE(TYPE_STRUCT) + _TYPE_DISPATCH_CASE(TYPE_MAP) _TYPE_DISPATCH_CASE(TYPE_HLL) _TYPE_DISPATCH_CASE(TYPE_OBJECT) _TYPE_DISPATCH_CASE(TYPE_PERCENTILE) diff --git a/fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java b/fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java index 3b2be65999d92..c6402288f7be1 100644 --- a/fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java +++ b/fe/fe-core/src/main/java/com/starrocks/qe/SessionVariable.java @@ -1263,7 +1263,7 @@ public static MaterializedViewRewriteMode parse(String str) { private boolean joinLateMaterialization = false; @VariableMgr.VarAttr(name = ENABLE_PARTITION_HASH_JOIN) - private boolean enablePartitionHashJoin = false; + private boolean enablePartitionHashJoin = true; @VariableMgr.VarAttr(name = ENABLE_PRUNE_COLUMN_AFTER_INDEX_FILTER, flag = VariableMgr.INVISIBLE) private boolean enablePruneColumnAfterIndexFilter = true;