-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix](intersect) fix coredump caused by intersect of nullable and not…
… nullable children (#36401)
- Loading branch information
Showing
3 changed files
with
117 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletions
7
regression-test/data/query_p0/set_operations/sql/intersect_nullable_not_nullable.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !intersect_nullable_not_nullable_1 -- | ||
c | ||
|
||
-- !intersect_nullable_not_nullable_2 -- | ||
c | ||
|
98 changes: 98 additions & 0 deletions
98
regression-test/suites/query_p0/set_operations/sql/intersect_nullable_not_nullable.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,98 @@ | ||
// Licensed to the Apache Software Foundation (ASF) under one | ||
// or more contributor license agreements. See the NOTICE file | ||
// distributed with this work for additional information | ||
// regarding copyright ownership. The ASF licenses this file | ||
// to you under the Apache License, Version 2.0 (the | ||
// "License"); you may not use this file except in compliance | ||
// with the License. You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, | ||
// software distributed under the License is distributed on an | ||
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the License for the | ||
// specific language governing permissions and limitations | ||
// under the License. | ||
|
||
suite("intersect_nullable_not_nullable") { | ||
sql """ | ||
drop table if exists intersect_nullable_not_nullable_t1; | ||
""" | ||
sql """ | ||
drop table if exists intersect_nullable_not_nullable_t2; | ||
""" | ||
sql """ | ||
drop table if exists intersect_nullable_not_nullable_t3; | ||
""" | ||
sql """ | ||
drop table if exists intersect_nullable_not_nullable_t4; | ||
""" | ||
sql """ | ||
create table intersect_nullable_not_nullable_t1 (k1 char(16) not null) distributed by hash(k1) properties("replication_num"="1"); | ||
""" | ||
sql """ | ||
insert into intersect_nullable_not_nullable_t1 values("a"), ("b"), ("c"), ("d"), ("e"); | ||
""" | ||
|
||
sql """ | ||
create table intersect_nullable_not_nullable_t2 (kk0 int, kk1 char(16) not null) distributed by hash(kk0) properties("replication_num"="1"); | ||
""" | ||
sql """ | ||
insert into intersect_nullable_not_nullable_t2 values(1, "b"), (2, "c"), (3, "d"), (4, "e"); | ||
""" | ||
|
||
sql """ | ||
create table intersect_nullable_not_nullable_t3 (kkk1 char(16) ) distributed by hash(kkk1) properties("replication_num"="1"); | ||
""" | ||
sql """ | ||
insert into intersect_nullable_not_nullable_t3 values("c"), ("d"), ("e"); | ||
""" | ||
|
||
sql """ | ||
create table intersect_nullable_not_nullable_t4 (kkkk1 char(16) ) distributed by hash(kkkk1) properties("replication_num"="1"); | ||
""" | ||
sql """ | ||
insert into intersect_nullable_not_nullable_t4 values("d"), ("e"); | ||
""" | ||
|
||
order_qt_intersect_nullable_not_nullable_1 """ | ||
( | ||
select * from intersect_nullable_not_nullable_t1 | ||
) | ||
intersect | ||
( | ||
select distinct kk1 from intersect_nullable_not_nullable_t2 | ||
) | ||
intersect | ||
( | ||
( | ||
select * from intersect_nullable_not_nullable_t3 | ||
) | ||
except | ||
( | ||
select * from intersect_nullable_not_nullable_t4 | ||
) | ||
); | ||
""" | ||
|
||
order_qt_intersect_nullable_not_nullable_2 """ | ||
( | ||
select * from intersect_nullable_not_nullable_t1 | ||
) | ||
intersect | ||
( | ||
( | ||
select * from intersect_nullable_not_nullable_t3 | ||
) | ||
except | ||
( | ||
select * from intersect_nullable_not_nullable_t4 | ||
) | ||
) | ||
intersect | ||
( | ||
select distinct kk1 from intersect_nullable_not_nullable_t2 | ||
); | ||
""" | ||
} |