-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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])(nereids)Support select catalog.db.table.column from xxx for nereids planner. #23221
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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};""" | ||
} | ||
} | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why we use special branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qualifier may only contain db name or contain full name (catalog.db.table),for the first case, need to concat the table name here, for the latter case, we don't need to.