diff --git a/be/src/vec/exec/join/vhash_join_node.cpp b/be/src/vec/exec/join/vhash_join_node.cpp index a42a8215fff729..1ddf498826eb23 100644 --- a/be/src/vec/exec/join/vhash_join_node.cpp +++ b/be/src/vec/exec/join/vhash_join_node.cpp @@ -1093,10 +1093,10 @@ Status HashJoinNode::extract_probe_join_column(Block& block, NullMap& null_map, auto& col_nullmap = nullable->get_null_map_data(); ignore_null |= !_probe_not_ignore_null[i]; + VectorizedUtils::update_null_map(null_map, col_nullmap); if (_build_not_ignore_null[i]) { raw_ptrs[i] = nullable; } else { - VectorizedUtils::update_null_map(null_map, col_nullmap); raw_ptrs[i] = &col_nested; } } else { diff --git a/regression-test/data/query/join/sql/full_join.out b/regression-test/data/query/join/sql/full_join.out new file mode 100644 index 00000000000000..c219e27748dd39 --- /dev/null +++ b/regression-test/data/query/join/sql/full_join.out @@ -0,0 +1,8 @@ +-- This file is automatically generated. You should know what you did if you want to edit this +-- !full_join -- +n fj n \N \N +n fj n \N \N + +-- !full_join_2 -- +n fj n \N \N + diff --git a/regression-test/suites/query/join/ddl/full_join_table.sql b/regression-test/suites/query/join/ddl/full_join_table.sql new file mode 100644 index 00000000000000..50490215414460 --- /dev/null +++ b/regression-test/suites/query/join/ddl/full_join_table.sql @@ -0,0 +1,11 @@ +CREATE TABLE `full_join_table` ( + `x` varchar(150) NULL COMMENT "" +) ENGINE=OLAP +UNIQUE KEY(`x`) +COMMENT "OLAP" +DISTRIBUTED BY HASH(`x`) BUCKETS 3 + PROPERTIES ( + "replication_allocation" = "tag.location.default: 1", + "in_memory" = "false", + "storage_format" = "V2" +) diff --git a/regression-test/suites/query/join/ddl/table.sql b/regression-test/suites/query/join/ddl/table.sql new file mode 100644 index 00000000000000..7d461bf86a2cab --- /dev/null +++ b/regression-test/suites/query/join/ddl/table.sql @@ -0,0 +1,16 @@ +CREATE TABLE `test_bucket_shuffle_join` ( + `id` int(11) NOT NULL COMMENT "", + `rectime` datetime NOT NULL COMMENT "" +) ENGINE=OLAP +UNIQUE KEY(`id`, `rectime`) +COMMENT "olap" +PARTITION BY RANGE(`rectime`) +( +PARTITION p202111 VALUES [('2021-11-01 00:00:00'), ('2021-12-01 00:00:00'))) +DISTRIBUTED BY HASH(`id`) BUCKETS 10 +PROPERTIES ( +"replication_allocation" = "tag.location.default: 1", +"in_memory" = "false", +"storage_format" = "V2" +) + diff --git a/regression-test/suites/query/join/load.groovy b/regression-test/suites/query/join/load.groovy index aa3a5402f287b9..81d44d93395c34 100644 --- a/regression-test/suites/query/join/load.groovy +++ b/regression-test/suites/query/join/load.groovy @@ -20,7 +20,7 @@ // and modified by Doris. suite("load") { - def tables=["test_join", "test_bucket_shuffle_join", "table_1", "table_2"] + def tables=["test_join", "full_join_table", "test_bucket_shuffle_join", "table_1", "table_2"] for (String table in tables) { sql """ DROP TABLE IF EXISTS $table """ @@ -37,5 +37,7 @@ suite("load") { sql """ insert into test_bucket_shuffle_join values(1, "2021-12-01 00:00:00"), (2, "2021-12-01 00:00:00"), (3, "2021-12-01 00:00:00")""" + sql """ INSERT INTO full_join_table(x) VALUES (NULL) """; + sql """ INSERT INTO table_2 VALUES ('H220427011909850160918','2022-04-27 16:00:33'),('T220427400109910160949','2022-04-27 16:00:54'),('T220427400123770120058','2022-04-27 16:00:56'),('T220427400126530112854','2022-04-27 16:00:34'),('T220427400127160144672','2022-04-27 16:00:10'),('T220427400127900184511','2022-04-27 16:00:34'),('T220427400129940120380','2022-04-27 16:00:23'),('T220427400139720192986','2022-04-27 16:00:34'),('T220427400140260152375','2022-04-27 16:00:02'),('T220427400153170104281','2022-04-27 16:00:31'),('H220427011909800104411','2022-04-27 16:00:14'),('H220427011909870184823','2022-04-27 16:00:36'),('T220427400115770144416','2022-04-27 16:00:12'),('T220427400126390112736','2022-04-27 16:00:19'),('T220427400128350120717','2022-04-27 16:00:56'),('T220427400129680120838','2022-04-27 16:00:39'),('T220427400136970192083','2022-04-27 16:00:51'),('H220427011909770192580','2022-04-27 16:00:04'),('H220427011909820192943','2022-04-27 16:00:23'),('T220427400109110184990','2022-04-27 16:00:29'),('T220427400109930192249','2022-04-27 16:00:56'),('T220427400123050168464','2022-04-27 16:00:37'),('T220427400124330112931','2022-04-27 16:00:56'),('T220427400124430144718','2022-04-27 16:00:07'),('T220427400130570160488','2022-04-27 16:00:34'),('T220427400130610112671','2022-04-27 16:00:30'),('T220427400137600160704','2022-04-27 16:00:35'),('T220427400144590176969','2022-04-27 16:00:49'),('T220427400146320176530','2022-04-27 16:00:34'),('T220427601780480120027','2022-04-27 16:00:58');""" } diff --git a/regression-test/suites/query/join/sql/full_join.sql b/regression-test/suites/query/join/sql/full_join.sql new file mode 100644 index 00000000000000..f74f0ead5372db --- /dev/null +++ b/regression-test/suites/query/join/sql/full_join.sql @@ -0,0 +1,2 @@ +SELECT 'n fj n', t1.x, t2.x FROM full_join_table AS t1 FULL JOIN full_join_table AS t2 ON t1.x = t2.x ORDER BY t1.x; +SELECT 'n fj n', t1.x, t2.x FROM full_join_table AS t1 FULL JOIN full_join_table AS t2 ON t1.x <=> t2.x ORDER BY t1.x;