-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Fix](multi-catalog) Fix read error in mixed partition locations.
- Loading branch information
1 parent
53f90cb
commit de2e81a
Showing
8 changed files
with
166 additions
and
48 deletions.
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
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
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
37 changes: 37 additions & 0 deletions
37
regression-test/data/external_table_emr_p2/hive/test_mixed_par_locations.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,37 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !01 -- | ||
1 Tom 48 shanghai male 20230101 | ||
2 Jerry 35 guangzhou male 20230101 | ||
3 Frank 25 hangzhou male 20230101 | ||
4 Ada 22 beijing female 20230101 | ||
5 Jason 46 shanghai male 20230102 | ||
6 Andy 38 guangzhou male 20230102 | ||
7 Sam 29 hangzhou male 20230102 | ||
8 Chloea 18 beijing female 20230102 | ||
|
||
-- !02 -- | ||
8 | ||
|
||
-- !03 -- | ||
guangzhou 2 | ||
hangzhou 2 | ||
shanghai 2 | ||
|
||
-- !01 -- | ||
1 Tom 48 shanghai male 20230101 | ||
2 Jerry 35 guangzhou male 20230101 | ||
3 Frank 25 hangzhou male 20230101 | ||
4 Ada 22 beijing female 20230101 | ||
5 Jason 46 shanghai male 20230102 | ||
6 Andy 38 guangzhou male 20230102 | ||
7 Sam 29 hangzhou male 20230102 | ||
8 Chloea 18 beijing female 20230102 | ||
|
||
-- !02 -- | ||
8 | ||
|
||
-- !03 -- | ||
guangzhou 2 | ||
hangzhou 2 | ||
shanghai 2 | ||
|
63 changes: 63 additions & 0 deletions
63
regression-test/suites/external_table_emr_p2/hive/test_mixed_par_locations.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,63 @@ | ||
// 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_mixed_par_locations", "p2") { | ||
|
||
def formats = ["_parquet", "_orc"] | ||
def q1 = """select * from test_mixed_par_locationsSUFFIX order by id;""" | ||
def q2 = """select count(id) from test_mixed_par_locationsSUFFIX;""" | ||
def q3 = """select city, count(*) from test_mixed_par_locations_parquet where sex = 'male' group by city order by city;""" | ||
|
||
String enabled = context.config.otherConfigs.get("enableExternalHiveTest") | ||
if (enabled != null && enabled.equalsIgnoreCase("true")) { | ||
try { | ||
String extHiveHmsHost = context.config.otherConfigs.get("extHiveHmsHost") | ||
String extHiveHmsPort = context.config.otherConfigs.get("extHiveHmsPort") | ||
String extAk = context.config.otherConfigs.get("extAk"); | ||
String extSk = context.config.otherConfigs.get("extSk"); | ||
String ext3Endpoint = context.config.otherConfigs.get("ext3Endpoint"); | ||
String extS3Region = context.config.otherConfigs.get("extS3Region"); | ||
String catalog_name = "test_mixed_par_locations" | ||
|
||
sql """drop catalog if exists ${catalog_name};""" | ||
sql """ | ||
create catalog if not exists ${catalog_name} properties ( | ||
'type'='hms', | ||
'hive.metastore.uris' = 'thrift://${extHiveHmsHost}:${extHiveHmsPort}', | ||
'AWS_ACCESS_KEY' = "${extAk}", | ||
'AWS_SECRET_KEY' = "${extSk}", | ||
'AWS_ENDPOINT' = "${ext3Endpoint}", | ||
'AWS_REGION' = "${extS3Region}" | ||
); | ||
""" | ||
logger.info("catalog " + catalog_name + " created") | ||
sql """switch ${catalog_name};""" | ||
logger.info("switched to catalog " + catalog_name) | ||
sql """use multi_catalog;""" | ||
logger.info("use multi_catalog") | ||
|
||
for (String format in formats) { | ||
logger.info("Process format " + format) | ||
qt_01 q1.replace("SUFFIX", format) | ||
qt_02 q2.replace("SUFFIX", format) | ||
qt_03 q3.replace("SUFFIX", format) | ||
} | ||
sql """drop catalog if exists ${catalog_name}""" | ||
} finally { | ||
} | ||
} | ||
} |