forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[cherry-pick](branch-2.1) impl partition pruning in runtime filer apa…
- Loading branch information
1 parent
443e87e
commit 5548020
Showing
4 changed files
with
229 additions
and
7 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
25 changes: 25 additions & 0 deletions
25
regression-test/data/external_table_p0/hive/test_hive_runtime_filter_partition_pruning.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,25 @@ | ||
-- This file is automatically generated. You should know what you did if you want to edit this | ||
-- !runtime_filter_partition_pruning1 -- | ||
3994 | ||
|
||
-- !runtime_filter_partition_pruning2 -- | ||
4990 | ||
|
||
-- !runtime_filter_partition_pruning3 -- | ||
1999 | ||
|
||
-- !runtime_filter_partition_pruning4 -- | ||
2994 | ||
|
||
-- !runtime_filter_partition_pruning1 -- | ||
3994 | ||
|
||
-- !runtime_filter_partition_pruning2 -- | ||
4990 | ||
|
||
-- !runtime_filter_partition_pruning3 -- | ||
1999 | ||
|
||
-- !runtime_filter_partition_pruning4 -- | ||
2994 | ||
|
71 changes: 71 additions & 0 deletions
71
...sion-test/suites/external_table_p0/hive/test_hive_runtime_filter_partition_pruning.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,71 @@ | ||
// 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_runtime_filter_partition_pruning", "p0,external,hive,external_docker,external_docker_hive") { | ||
def test_runtime_filter_partition_pruning = { | ||
qt_runtime_filter_partition_pruning1 """ | ||
select count(*) from partition_table where nation = | ||
(select nation from partition_table | ||
group by nation having count(*) > 0 | ||
order by nation desc limit 1); | ||
""" | ||
qt_runtime_filter_partition_pruning2 """ | ||
select count(*) from partition_table where nation in | ||
(select nation from partition_table | ||
group by nation having count(*) > 0 | ||
order by nation desc limit 2); | ||
""" | ||
qt_runtime_filter_partition_pruning3 """ | ||
select count(*) from partition_table where city = | ||
(select city from partition_table | ||
group by city having count(*) > 0 | ||
order by city desc limit 1); | ||
""" | ||
qt_runtime_filter_partition_pruning4 """ | ||
select count(*) from partition_table where city in | ||
(select city from partition_table | ||
group by city having count(*) > 0 | ||
order by city desc limit 2); | ||
""" | ||
} | ||
|
||
String enabled = context.config.otherConfigs.get("enableHiveTest") | ||
if (enabled == null || !enabled.equalsIgnoreCase("true")) { | ||
logger.info("diable Hive test.") | ||
return; | ||
} | ||
|
||
for (String hivePrefix : ["hive2", "hive3"]) { | ||
try { | ||
String hms_port = context.config.otherConfigs.get(hivePrefix + "HmsPort") | ||
String catalog_name = "${hivePrefix}_test_partitions" | ||
String externalEnvIp = context.config.otherConfigs.get("externalEnvIp") | ||
|
||
sql """drop catalog if exists ${catalog_name}""" | ||
sql """create catalog if not exists ${catalog_name} properties ( | ||
"type"="hms", | ||
'hive.metastore.uris' = 'thrift://${externalEnvIp}:${hms_port}' | ||
);""" | ||
sql """use `${catalog_name}`.`default`""" | ||
|
||
test_runtime_filter_partition_pruning() | ||
|
||
} finally { | ||
} | ||
} | ||
} | ||
|