-
Notifications
You must be signed in to change notification settings - Fork 605
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add CH-benCHmark queries (#5600)
* add q02 * add q02 and q19 * remove tpcc_ prefix * add q12 * Add q11 and q17 * commit * add transactions * add q03 * add q04 * remove * add more queries * fix * create output for q17 Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
- Loading branch information
1 parent
8a650e5
commit f4e4475
Showing
34 changed files
with
6,391 additions
and
1,015 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,66 @@ | ||
include ./create_sources.slt.part | ||
# Create tpch tables | ||
include ../tpch/create_tables.slt.part | ||
|
||
# Drop unneeded tables | ||
statement ok | ||
DROP TABLE lineitem; | ||
|
||
statement ok | ||
DROP TABLE orders; | ||
|
||
statement ok | ||
DROP TABLE customer; | ||
|
||
statement ok | ||
DROP TABLE partsupp; | ||
|
||
statement ok | ||
DROP TABLE part; | ||
|
||
# Insert data to tpch tables | ||
include ../tpch/insert_nation.slt.part | ||
include ../tpch/insert_region.slt.part | ||
include ../tpch/insert_supplier.slt.part | ||
|
||
# Create materialized sources from tpcc tables | ||
include ./create_sources.slt.part | ||
|
||
# Ensure that the upstream data is fully consumed | ||
statement ok | ||
flush; | ||
|
||
# include ./q01.slt.part --> precision error | ||
# Run CH-benCHmark queries | ||
include ./q01.slt.part | ||
include ./q02.slt.part | ||
include ./q03.slt.part | ||
include ./q04.slt.part | ||
# include ./q05.slt.part --> no output | ||
include ./q06.slt.part | ||
# include ./q07.slt.part --> no output | ||
# include ./q08.slt.part --> no output | ||
include ./q09.slt.part | ||
include ./q10.slt.part | ||
include ./q11.slt.part | ||
include ./q12.slt.part | ||
include ./q13.slt.part | ||
# include ./q14.slt.part --> panic, see issue: https://github.com/risingwavelabs/risingwave/issues/5563 | ||
include ./q15.slt.part | ||
include ./q16.slt.part | ||
include ./q17.slt.part | ||
include ./q18.slt.part | ||
# include ./q19.slt.part --> precision error | ||
include ./q20.slt.part | ||
include ./q21.slt.part | ||
include ./q22.slt.part | ||
|
||
include ./drop_sources.slt.part | ||
include ../tpch/drop_tables.slt.part | ||
|
||
# Drop tpch tables | ||
statement ok | ||
DROP TABLE supplier; | ||
|
||
statement ok | ||
DROP TABLE region; | ||
|
||
statement ok | ||
DROP TABLE nation; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,26 @@ | ||
statement ok | ||
DROP SOURCE tpcc_customer; | ||
DROP SOURCE customer; | ||
|
||
statement ok | ||
DROP SOURCE tpcc_district; | ||
DROP SOURCE district; | ||
|
||
# statement ok | ||
# DROP SOURCE tpcc_history; | ||
# DROP SOURCE history; | ||
|
||
statement ok | ||
DROP SOURCE tpcc_item; | ||
DROP SOURCE item; | ||
|
||
statement ok | ||
DROP SOURCE tpcc_neworder; | ||
DROP SOURCE neworder; | ||
|
||
statement ok | ||
DROP SOURCE tpcc_orderline; | ||
DROP SOURCE orderline; | ||
|
||
statement ok | ||
DROP SOURCE tpcc_orders; | ||
DROP SOURCE orders; | ||
|
||
statement ok | ||
DROP SOURCE tpcc_stock; | ||
DROP SOURCE stock; | ||
|
||
statement ok | ||
DROP SOURCE tpcc_warehouse; | ||
DROP SOURCE warehouse; |
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,17 @@ | ||
query IIIIII rowsort | ||
select ol_number, | ||
sum(ol_quantity) as sum_qty, | ||
sum(ol_amount) as sum_amount, | ||
avg(ol_quantity) as avg_qty, | ||
avg(ol_amount) as avg_amount, | ||
count(*) as count_order | ||
from orderline | ||
where ol_delivery_d > '2007-01-02 00:00:00.000000' | ||
group by ol_number order by ol_number; | ||
---- | ||
1 600 84 5 0.7 120 | ||
2 550 0 5 0 110 | ||
3 560 14739 5.0909090909090909090909090909 133.9909090909091 110 | ||
4 550 44.1 5 0.4009090770374645 110 | ||
5 550 0 5 0 110 | ||
6 200 0 5 0 40 |
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,22 @@ | ||
query ITTITTTT rowsort | ||
select s_suppkey, s_name, n_name, i_id, i_name, s_address, s_phone, s_comment | ||
from item, supplier, stock, nation, region, | ||
(select st_i_id as m_i_id, | ||
min(st_quantity) as m_st_quantity | ||
from stock, supplier, nation, region | ||
where (st_w_id*st_i_id) % 10000=s_suppkey | ||
and s_nationkey=n_nationkey | ||
and n_regionkey=r_regionkey | ||
and r_name like 'EUROP%' | ||
group by st_i_id) m | ||
where i_id = st_i_id | ||
and (st_w_id * st_i_id) % 10000 = s_suppkey | ||
and s_nationkey = n_nationkey | ||
and n_regionkey = r_regionkey | ||
and i_data like '%B' | ||
and r_name like 'EUROP%' | ||
and i_id=m_i_id | ||
and st_quantity = m_st_quantity | ||
order by n_name, s_name, i_id; | ||
---- | ||
11 Supplier#000000011 GERMANY 11 t4ccklaRBqjFXhCnH JfwTs,LZrV, M,9C 28-613-996-1505 y ironic packages. slyly ironic accounts affix furiously; ironically unusual excuses across the flu |
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,36 @@ | ||
query IIIIT rowsort | ||
select ol_o_id, ol_w_id, ol_d_id, | ||
sum(ol_amount) as revenue, o_entry_d | ||
from customer, neworder, orders, orderline | ||
where c_state like 'A%' | ||
and c_id = o_c_id | ||
and c_w_id = o_w_id | ||
and c_d_id = o_d_id | ||
and no_w_id = o_w_id | ||
and no_d_id = o_d_id | ||
and no_o_id = o_id | ||
and ol_w_id = o_w_id | ||
and ol_d_id = o_d_id | ||
and ol_o_id = o_id | ||
and o_entry_d > '2007-01-02 00:00:00.000000' | ||
group by ol_o_id, ol_w_id, ol_d_id, o_entry_d | ||
order by revenue desc, o_entry_d; | ||
---- | ||
2111 1 4 21 2015-11-22 00:00:00 | ||
2107 1 4 0 2015-11-22 00:00:00 | ||
2105 1 7 0 2015-11-22 00:00:00 | ||
2112 1 2 0 2015-11-22 00:00:00 | ||
2106 1 9 0 2015-11-22 00:00:00 | ||
2108 1 6 0 2015-11-22 00:00:00 | ||
2108 1 2 0 2015-11-22 00:00:00 | ||
2109 1 4 0 2015-11-22 00:00:00 | ||
2112 1 8 0 2015-11-22 00:00:00 | ||
2114 1 4 0 2015-11-22 00:00:00 | ||
2110 1 7 0 2015-11-22 00:00:00 | ||
2107 1 8 0 2015-11-22 00:00:00 | ||
2113 1 2 0 2015-11-22 00:00:00 | ||
2106 1 4 0 2015-11-22 00:00:00 | ||
2111 1 9 0 2015-11-22 00:00:00 | ||
2112 1 4 0 2015-11-22 00:00:00 | ||
2107 1 2 0 2015-11-22 00:00:00 | ||
2113 1 6 0 2015-11-22 00:00:00 |
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,23 @@ | ||
query II rowsort | ||
select o_ol_cnt, count(*) as order_count | ||
from orders | ||
where o_entry_d >= '2007-01-02 00:00:00.000000' | ||
and o_entry_d < '2017-01-02 00:00:00.000000' | ||
and exists (select * | ||
from orderline | ||
where o_id = ol_o_id | ||
and o_w_id = ol_w_id | ||
and o_d_id = ol_d_id | ||
and ol_delivery_d >= o_entry_d) | ||
group by o_ol_cnt | ||
order by o_ol_cnt; | ||
---- | ||
5 10 | ||
6 14 | ||
7 14 | ||
8 16 | ||
9 16 | ||
10 10 | ||
11 12 | ||
12 6 | ||
13 2 |
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,8 @@ | ||
query R rowsort | ||
select sum(ol_amount) as revenue | ||
from orderline | ||
where ol_delivery_d >= '1999-01-01 00:00:00.000000' | ||
and ol_delivery_d < '2020-01-01 00:00:00.000000' | ||
and ol_quantity between 1 and 100000; | ||
---- | ||
5446.26 |
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,16 @@ | ||
query TTR rowsort | ||
select n_name, extract(year from o_entry_d::timestamp) as l_year, sum(ol_amount) as sum_profit | ||
from item, stock, supplier, orderline, orders, nation | ||
where ol_i_id = st_i_id | ||
and ol_supply_w_id = st_w_id | ||
and (st_w_id * st_i_id) % 10000 = s_suppkey | ||
and ol_w_id = o_w_id | ||
and ol_d_id = o_d_id | ||
and ol_o_id = o_id | ||
and ol_i_id = i_id | ||
and s_nationkey = n_nationkey | ||
and i_data like '%BB' | ||
group by n_name, extract(year from o_entry_d::timestamp) | ||
order by n_name, l_year desc; | ||
---- | ||
GERMANY 2015 0 |
Oops, something went wrong.