forked from apache/doris
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,758 additions
and
16 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
88 changes: 88 additions & 0 deletions
88
regression-test/suites/nereids_tpch_shape_sf1000_p0/rf_prune/rf10.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,88 @@ | ||
/* | ||
* 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("rf10") { | ||
String db = context.config.getDbNameByFile(new File(context.file.parent)) | ||
sql "use ${db}" | ||
sql 'set enable_nereids_planner=true' | ||
sql 'set enable_fallback_to_original_planner=false' | ||
sql "set runtime_filter_mode='GLOBAL'" | ||
|
||
sql 'set exec_mem_limit=21G' | ||
sql 'SET enable_pipeline_engine = true' | ||
sql 'set parallel_pipeline_task_num=8' | ||
sql 'set be_number_for_test=3' | ||
String query = """ | ||
explain physical plan | ||
select | ||
c_custkey, | ||
c_name, | ||
sum(l_extendedprice * (1 - l_discount)) as revenue, | ||
c_acctbal, | ||
n_name, | ||
c_address, | ||
c_phone, | ||
c_comment | ||
from | ||
customer, | ||
orders, | ||
lineitem, | ||
nation | ||
where | ||
c_custkey = o_custkey | ||
and l_orderkey = o_orderkey | ||
and o_orderdate >= date '1993-10-01' | ||
and o_orderdate < date '1993-10-01' + interval '3' month | ||
and l_returnflag = 'R' | ||
and c_nationkey = n_nationkey | ||
group by | ||
c_custkey, | ||
c_name, | ||
c_acctbal, | ||
c_phone, | ||
n_name, | ||
c_address, | ||
c_comment | ||
order by | ||
revenue desc | ||
limit 20; | ||
""" | ||
def getRuntimeFilterCountFromPlan = { plan -> { | ||
int count = 0 | ||
plan.eachMatch("RF\\d+\\[") { | ||
ch -> count ++ | ||
} | ||
return count | ||
}} | ||
// prune 1 RF | ||
sql "set enable_runtime_filter_prune=false" | ||
String plan1 = sql "${query}" | ||
int count1 = getRuntimeFilterCountFromPlan(plan1) | ||
|
||
sql "set enable_runtime_filter_prune=true" | ||
String plan2 = sql "${query}" | ||
|
||
log.info("tcph_sf1000 h10 before prune:\n" + plan1) | ||
log.info("tcph_sf1000 h10 after prune:\n" + plan2) | ||
|
||
int count2 = getRuntimeFilterCountFromPlan(plan2) | ||
|
||
assertEquals(3, count1) | ||
assertEquals(2, count2) | ||
} |
84 changes: 84 additions & 0 deletions
84
regression-test/suites/nereids_tpch_shape_sf1000_p0/rf_prune/rf11.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,84 @@ | ||
/* | ||
* 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("rf11") { | ||
String db = context.config.getDbNameByFile(new File(context.file.parent)) | ||
sql "use ${db}" | ||
sql 'set enable_nereids_planner=true' | ||
sql 'set enable_fallback_to_original_planner=false' | ||
sql "set runtime_filter_mode='GLOBAL'" | ||
sql 'set parallel_pipeline_task_num=8' | ||
sql 'set exec_mem_limit=21G' | ||
sql 'SET enable_pipeline_engine = true' | ||
sql 'set be_number_for_test=3' | ||
|
||
|
||
|
||
def String query = """ | ||
explain physical plan | ||
select | ||
ps_partkey, | ||
sum(ps_supplycost * ps_availqty) as value | ||
from | ||
partsupp, | ||
supplier, | ||
nation | ||
where | ||
ps_suppkey = s_suppkey | ||
and s_nationkey = n_nationkey | ||
and n_name = 'GERMANY' | ||
group by | ||
ps_partkey having | ||
sum(ps_supplycost * ps_availqty) > ( | ||
select | ||
sum(ps_supplycost * ps_availqty) * 0.000002 | ||
from | ||
partsupp, | ||
supplier, | ||
nation | ||
where | ||
ps_suppkey = s_suppkey | ||
and s_nationkey = n_nationkey | ||
and n_name = 'GERMANY' | ||
) | ||
order by | ||
value desc; | ||
""" | ||
|
||
def getRuntimeFilterCountFromPlan = { plan -> { | ||
int count = 0 | ||
plan.eachMatch("RF\\d+\\[") { | ||
ch -> count ++ | ||
} | ||
return count | ||
}} | ||
|
||
sql "set enable_runtime_filter_prune=false" | ||
String plan1 = sql "${query}" | ||
int count1 = getRuntimeFilterCountFromPlan(plan1) | ||
sql "set enable_runtime_filter_prune=true" | ||
String plan2 = sql "${query}" | ||
int count2 = getRuntimeFilterCountFromPlan(plan2) | ||
|
||
log.info("tcph_sf1000 h11 before prune:\n" + plan1) | ||
log.info("tcph_sf1000 h11 after prune:\n" + plan2) | ||
|
||
assertEquals(4, count1) | ||
assertEquals(count1, count2) | ||
} |
86 changes: 86 additions & 0 deletions
86
regression-test/suites/nereids_tpch_shape_sf1000_p0/rf_prune/rf12.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,86 @@ | ||
/* | ||
* 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("rf12") { | ||
String db = context.config.getDbNameByFile(new File(context.file.parent)) | ||
sql "use ${db}" | ||
sql 'set enable_nereids_planner=true' | ||
sql 'set enable_fallback_to_original_planner=false' | ||
sql "set runtime_filter_mode='GLOBAL'" | ||
sql 'set parallel_pipeline_task_num=8' | ||
sql 'set exec_mem_limit=21G' | ||
sql 'SET enable_pipeline_engine = true' | ||
sql 'set be_number_for_test=3' | ||
|
||
def query = """ | ||
explain physical plan | ||
select | ||
l_shipmode, | ||
sum(case | ||
when o_orderpriority = '1-URGENT' | ||
or o_orderpriority = '2-HIGH' | ||
then 1 | ||
else 0 | ||
end) as high_line_count, | ||
sum(case | ||
when o_orderpriority <> '1-URGENT' | ||
and o_orderpriority <> '2-HIGH' | ||
then 1 | ||
else 0 | ||
end) as low_line_count | ||
from | ||
orders, | ||
lineitem | ||
where | ||
o_orderkey = l_orderkey | ||
and l_shipmode in ('MAIL', 'SHIP') | ||
and l_commitdate < l_receiptdate | ||
and l_shipdate < l_commitdate | ||
and l_receiptdate >= date '1994-01-01' | ||
and l_receiptdate < date '1994-01-01' + interval '1' year | ||
group by | ||
l_shipmode | ||
order by | ||
l_shipmode; | ||
""" | ||
|
||
|
||
def getRuntimeFilterCountFromPlan = { plan -> { | ||
int count = 0 | ||
plan.eachMatch("RF\\d+\\[") { | ||
ch -> count ++ | ||
} | ||
return count | ||
}} | ||
|
||
sql "set enable_runtime_filter_prune=false" | ||
String plan1 = sql "${query}" | ||
int count1 = getRuntimeFilterCountFromPlan(plan1) | ||
sql "set enable_runtime_filter_prune=true" | ||
String plan2 = sql "${query}" | ||
|
||
log.info("tcph_sf1000 h12 before prune:\n" + plan1) | ||
log.info("tcph_sf1000 h12 after prune:\n" + plan2) | ||
|
||
int count2 = getRuntimeFilterCountFromPlan(plan2) | ||
assertEquals(count1, count2) | ||
assertEquals(1, count1) | ||
|
||
|
||
} |
Oops, something went wrong.