-
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])(nereids)Support select catalog.db.table.column from xxx for ne…
…reids planner. #23221 Nereids doesn't support select table.* from table, this pr is to fix this bug. Support three layer qualifier. (catalog.database.table)
- Loading branch information
Showing
4 changed files
with
200 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
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
97 changes: 97 additions & 0 deletions
97
regression-test/data/external_table_p2/hive/test_hive_star_qualifier.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,97 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !test1 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test2 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test3 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test4 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test5 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test6 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test7 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test8 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test9 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test10 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test11 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
||
-- !test12 -- | ||
1 1 | ||
2 1 | ||
3 2 | ||
4 2 | ||
5 \N | ||
6 \N | ||
|
62 changes: 62 additions & 0 deletions
62
regression-test/suites/external_table_p2/hive/test_hive_star_qualifier.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,62 @@ | ||
// 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("test_hive_star_qualifier", "p2,external,hive,external_remote,external_remote_hive") { | ||
String catalog_name = "test_hive_star_qualifier" | ||
|
||
def test1 = """select * from ${catalog_name}.multi_catalog.one_partition order by id;""" | ||
def test2 = """select * from multi_catalog.one_partition order by id;""" | ||
def test3 = """select * from one_partition order by id;""" | ||
def test4 = """select one_partition.* from ${catalog_name}.multi_catalog.one_partition order by id;""" | ||
def test5 = """select one_partition.* from multi_catalog.one_partition order by id;""" | ||
def test6 = """select one_partition.* from one_partition order by id;""" | ||
def test7 = """select multi_catalog.one_partition.* from ${catalog_name}.multi_catalog.one_partition order by id;""" | ||
def test8 = """select multi_catalog.one_partition.* from multi_catalog.one_partition order by id;""" | ||
def test9 = """select multi_catalog.one_partition.* from one_partition order by id;""" | ||
def test10 = """select ${catalog_name}.multi_catalog.one_partition.* from ${catalog_name}.multi_catalog.one_partition order by id;""" | ||
def test11 = """select ${catalog_name}.multi_catalog.one_partition.* from multi_catalog.one_partition order by id;""" | ||
def test12 = """select ${catalog_name}.multi_catalog.one_partition.* from one_partition order by id;""" | ||
|
||
String enabled = context.config.otherConfigs.get("enableExternalHiveTest") | ||
if (enabled != null && enabled.equalsIgnoreCase("true")) { | ||
String extHiveHmsHost = context.config.otherConfigs.get("extHiveHmsHost") | ||
String extHiveHmsPort = context.config.otherConfigs.get("extHiveHmsPort") | ||
sql """drop catalog if exists ${catalog_name};""" | ||
sql """ | ||
create catalog if not exists ${catalog_name} properties ( | ||
'type'='hms', | ||
'hadoop.username' = 'hadoop', | ||
'hive.metastore.uris' = 'thrift://${extHiveHmsHost}:${extHiveHmsPort}' | ||
); | ||
""" | ||
sql """use ${catalog_name}.multi_catalog""" | ||
qt_test1 test1 | ||
qt_test2 test2 | ||
qt_test3 test3 | ||
qt_test4 test4 | ||
qt_test5 test5 | ||
qt_test6 test6 | ||
qt_test7 test7 | ||
qt_test8 test8 | ||
qt_test9 test9 | ||
qt_test10 test10 | ||
qt_test11 test11 | ||
qt_test12 test12 | ||
sql """drop catalog if exists ${catalog_name};""" | ||
} | ||
} | ||
|