Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix](case)Fix multiple case tables with the same name causing case f… #43043

Merged
merged 1 commit into from
Nov 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions regression-test/suites/nereids_p0/union/test_union.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
suite("test_union") {
sql "SET enable_nereids_planner=true"
sql "SET enable_fallback_to_original_planner=false"
String suiteName = "nereids_union_test_union"
String viewName = "${suiteName}_view"
def db = "nereids_test_query_db"
sql "use ${db}"

Expand Down Expand Up @@ -174,14 +176,14 @@ suite("test_union") {
// test_union_bug
// PALO-3617
qt_union36 """select * from (select 1 as a, 2 as b union select 3, 3) c where a = 1"""
sql """drop view if exists nullable"""
sql """CREATE VIEW `nullable` AS SELECT `a`.`k1` AS `n1`, `b`.`k2` AS `n2`
sql """drop view if exists ${viewName}"""
sql """CREATE VIEW `${viewName}` AS SELECT `a`.`k1` AS `n1`, `b`.`k2` AS `n2`
FROM `default_cluster:${db}`.`baseall` a LEFT OUTER JOIN
`default_cluster:${db}`.`bigtable` b ON `a`.`k1` = `b`.`k1` + 10
WHERE `b`.`k2` IS NULL"""
order_qt_union37 """select n1 from nullable union all select n2 from nullable"""
qt_union38 """(select n1 from nullable) union all (select n2 from nullable order by n1) order by n1"""
qt_union39 """(select n1 from nullable) union all (select n2 from nullable) order by n1"""
order_qt_union37 """select n1 from ${viewName} union all select n2 from ${viewName}"""
qt_union38 """(select n1 from ${viewName}) union all (select n2 from ${viewName} order by n1) order by n1"""
qt_union39 """(select n1 from ${viewName}) union all (select n2 from ${viewName}) order by n1"""


// test_union_different_column
Expand Down
12 changes: 7 additions & 5 deletions regression-test/suites/query_p0/union/test_union.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
// under the License.

suite("test_union") {
String suiteName = "query_union_test_union"
String viewName = "${suiteName}_view"
def db = "test_query_db"
sql "use ${db}"

Expand Down Expand Up @@ -172,14 +174,14 @@ suite("test_union") {
// test_union_bug
// PALO-3617
qt_union36 """select * from (select 1 as a, 2 as b union select 3, 3) c where a = 1"""
sql """drop view if exists nullable"""
sql """CREATE VIEW `nullable` AS SELECT `a`.`k1` AS `n1`, `b`.`k2` AS `n2`
sql """drop view if exists ${viewName}"""
sql """CREATE VIEW `${viewName}` AS SELECT `a`.`k1` AS `n1`, `b`.`k2` AS `n2`
FROM `default_cluster:${db}`.`baseall` a LEFT OUTER JOIN
`default_cluster:${db}`.`bigtable` b ON `a`.`k1` = `b`.`k1` + 10
WHERE `b`.`k2` IS NULL"""
order_qt_union37 """select n1 from nullable union all select n2 from nullable"""
qt_union38 """(select n1 from nullable) union all (select n2 from nullable order by n1) order by n1"""
qt_union39 """(select n1 from nullable) union all (select n2 from nullable) order by n1"""
order_qt_union37 """select n1 from ${viewName} union all select n2 from ${viewName}"""
qt_union38 """(select n1 from ${viewName}) union all (select n2 from ${viewName} order by n1) order by n1"""
qt_union39 """(select n1 from ${viewName}) union all (select n2 from ${viewName}) order by n1"""


// test_union_different_column
Expand Down
Loading