diff --git a/be/src/vec/exec/join/vhash_join_node.cpp b/be/src/vec/exec/join/vhash_join_node.cpp index 8b52608433c1cc..b16ef0cc5048f7 100644 --- a/be/src/vec/exec/join/vhash_join_node.cpp +++ b/be/src/vec/exec/join/vhash_join_node.cpp @@ -1290,7 +1290,7 @@ void HashJoinNode::_hash_table_init(RuntimeState* state) { } auto is_null = data_type->is_nullable(); - has_null |= is_null; + has_null |= is_null || _should_convert_build_side_to_nullable[i]; _build_key_sz[i] = data_type->get_maximum_size_of_value_in_memory() - (is_null ? 1 : 0); _probe_key_sz[i] = _build_key_sz[i]; diff --git a/regression-test/data/query_p0/join/test_half_join_nullable_build_side.out b/regression-test/data/query_p0/join/test_half_join_nullable_build_side.out index 6f7d74acd379db..8404bee641f5b2 100644 --- a/regression-test/data/query_p0/join/test_half_join_nullable_build_side.out +++ b/regression-test/data/query_p0/join/test_half_join_nullable_build_side.out @@ -126,3 +126,11 @@ 2 111 111 3 1111 1111 +-- !sql30 -- +1 11 11 1 11 11 +2 111 111 4 111 111 +2 111 111 2 111 111 +3 1111 1111 3 1111 1111 +4 \N \N \N \N \N +5 1111 1111 3 1111 1111 + diff --git a/regression-test/suites/query_p0/join/test_half_join_nullable_build_side.groovy b/regression-test/suites/query_p0/join/test_half_join_nullable_build_side.groovy index bddccb26ab11e9..a828980b381f14 100644 --- a/regression-test/suites/query_p0/join/test_half_join_nullable_build_side.groovy +++ b/regression-test/suites/query_p0/join/test_half_join_nullable_build_side.groovy @@ -277,4 +277,13 @@ suite("test_half_join_nullable_build_side", "query,p0") { test_half_join_nullable_build_side_l2 l right semi join test_half_join_nullable_build_side_r2 r on l.v2 = r.v2 order by 1, 2, 3; """ + + qt_sql30 """ + select + * + from + test_half_join_nullable_build_side_l2 l + left join test_half_join_nullable_build_side_l r on l.v2 <=> r.v2 + order by 1, 2, 3, 4 desc; + """ } \ No newline at end of file