You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by yi...@apache.org on 2022/05/23 05:29:42 UTC

[incubator-doris] branch master updated: [Bug-Fix][Vectorized] Full join return error result (#9690)

This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-doris.git


The following commit(s) were added to refs/heads/master by this push:
     new 500c36717d [Bug-Fix][Vectorized] Full join return error result (#9690)
500c36717d is described below

commit 500c36717d5bd860fdcedb0d74cf93facefa8770
Author: HappenLee <ha...@hotmail.com>
AuthorDate: Mon May 23 13:29:37 2022 +0800

    [Bug-Fix][Vectorized] Full join return error result (#9690)
    
    Co-authored-by: lihaopeng <li...@baidu.com>
---
 be/src/vec/exec/join/vhash_join_node.cpp                 |  2 +-
 regression-test/data/query/join/sql/full_join.out        |  8 ++++++++
 .../suites/query/join/ddl/full_join_table.sql            | 11 +++++++++++
 regression-test/suites/query/join/ddl/table.sql          | 16 ++++++++++++++++
 regression-test/suites/query/join/load.groovy            |  4 +++-
 regression-test/suites/query/join/sql/full_join.sql      |  2 ++
 6 files changed, 41 insertions(+), 2 deletions(-)

diff --git a/be/src/vec/exec/join/vhash_join_node.cpp b/be/src/vec/exec/join/vhash_join_node.cpp
index a42a8215ff..1ddf498826 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 0000000000..c219e27748
--- /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 0000000000..5049021541
--- /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 0000000000..7d461bf86a
--- /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 aa3a5402f2..81d44d9339 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'),('T220427400 [...]
 }
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 0000000000..f74f0ead53
--- /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;


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org