[Bug-Fix][Vectorized] Full join return error result (#9690)

Co-authored-by: lihaopeng <lihaopeng@baidu.com>
This commit is contained in:
HappenLee
2022-05-23 13:29:37 +08:00
committed by GitHub
parent 77297bb7ee
commit 500c36717d
6 changed files with 41 additions and 2 deletions

View File

@ -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 {

View File

@ -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

View File

@ -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"
)

View File

@ -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"
)

View File

@ -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');"""
}

View File

@ -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;