Skip to content

Commit

Permalink
Merge branch 'main' into waruto/improve_value_encoding
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Oct 18, 2022
2 parents f284636 + f4e4475 commit 180dc10
Show file tree
Hide file tree
Showing 48 changed files with 6,582 additions and 1,097 deletions.
13 changes: 13 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 56 additions & 3 deletions e2e_test/ch-benchmark/ch_benchmark.slt
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;
36 changes: 18 additions & 18 deletions e2e_test/ch-benchmark/create_sources.slt.part
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
statement ok
CREATE MATERIALIZED SOURCE tpcc_customer (
CREATE MATERIALIZED SOURCE customer (
c_id INTEGER,
c_d_id INTEGER,
c_w_id INTEGER,
Expand All @@ -25,13 +25,13 @@ CREATE MATERIALIZED SOURCE tpcc_customer (
PRIMARY KEY (c_id, c_d_id, c_w_id)
) with (
connector = 'kafka',
topic = 'tpcc_customer',
topic = 'customer',
properties.bootstrap.server = '127.0.0.1:29092',
scan.startup.mode = 'earliest'
) ROW FORMAT DEBEZIUM_JSON;

statement ok
CREATE MATERIALIZED SOURCE tpcc_district (
CREATE MATERIALIZED SOURCE district (
d_id INTEGER,
d_w_id INTEGER,
d_name VARCHAR,
Expand All @@ -46,13 +46,13 @@ CREATE MATERIALIZED SOURCE tpcc_district (
PRIMARY KEY (d_id, d_w_id)
) with (
connector = 'kafka',
topic = 'tpcc_district',
topic = 'district',
properties.bootstrap.server = '127.0.0.1:29092',
scan.startup.mode = 'earliest'
) ROW FORMAT DEBEZIUM_JSON;

# statement ok
# CREATE MATERIALIZED SOURCE tpcc_history (
# CREATE MATERIALIZED SOURCE history (
# h_c_id INTEGER,
# h_c_d_id INTEGER,
# h_c_w_id INTEGER,
Expand All @@ -63,13 +63,13 @@ CREATE MATERIALIZED SOURCE tpcc_district (
# h_data VARCHAR
# ) with (
# connector = 'kafka',
# topic = 'tpcc_history',
# topic = 'history',
# properties.bootstrap.server = '127.0.0.1:29092',
# scan.startup.mode = 'earliest'
# ) ROW FORMAT DEBEZIUM_JSON;

statement ok
CREATE MATERIALIZED SOURCE tpcc_item (
CREATE MATERIALIZED SOURCE item (
i_id INTEGER,
i_im_id INTEGER,
i_name VARCHAR,
Expand All @@ -78,26 +78,26 @@ CREATE MATERIALIZED SOURCE tpcc_item (
PRIMARY KEY (i_id)
) with (
connector = 'kafka',
topic = 'tpcc_item',
topic = 'item',
properties.bootstrap.server = '127.0.0.1:29092',
scan.startup.mode = 'earliest'
) ROW FORMAT DEBEZIUM_JSON;

statement ok
CREATE MATERIALIZED SOURCE tpcc_neworder (
CREATE MATERIALIZED SOURCE neworder (
no_o_id INTEGER,
no_d_id INTEGER,
no_w_id INTEGER,
PRIMARY KEY (no_o_id, no_d_id, no_w_id)
) with (
connector = 'kafka',
topic = 'tpcc_neworder',
topic = 'neworder',
properties.bootstrap.server = '127.0.0.1:29092',
scan.startup.mode = 'earliest'
) ROW FORMAT DEBEZIUM_JSON;

statement ok
CREATE MATERIALIZED SOURCE tpcc_orderline (
CREATE MATERIALIZED SOURCE orderline (
ol_o_id INTEGER,
ol_d_id INTEGER,
ol_w_id INTEGER,
Expand All @@ -111,13 +111,13 @@ CREATE MATERIALIZED SOURCE tpcc_orderline (
PRIMARY KEY (ol_o_id, ol_d_id, ol_w_id, ol_number)
) with (
connector = 'kafka',
topic = 'tpcc_orderline',
topic = 'orderline',
properties.bootstrap.server = '127.0.0.1:29092',
scan.startup.mode = 'earliest'
) ROW FORMAT DEBEZIUM_JSON;

statement ok
CREATE MATERIALIZED SOURCE tpcc_orders (
CREATE MATERIALIZED SOURCE orders (
o_id INTEGER,
o_d_id INTEGER,
o_w_id INTEGER,
Expand All @@ -129,13 +129,13 @@ CREATE MATERIALIZED SOURCE tpcc_orders (
PRIMARY KEY (o_id, o_d_id, o_w_id)
) with (
connector = 'kafka',
topic = 'tpcc_orders',
topic = 'orders',
properties.bootstrap.server = '127.0.0.1:29092',
scan.startup.mode = 'earliest'
) ROW FORMAT DEBEZIUM_JSON;

statement ok
CREATE MATERIALIZED SOURCE tpcc_stock (
CREATE MATERIALIZED SOURCE stock (
st_i_id INTEGER,
st_w_id INTEGER,
st_quantity INTEGER,
Expand All @@ -156,13 +156,13 @@ CREATE MATERIALIZED SOURCE tpcc_stock (
PRIMARY KEY (st_i_id, st_w_id)
) with (
connector = 'kafka',
topic = 'tpcc_stock',
topic = 'stock',
properties.bootstrap.server = '127.0.0.1:29092',
scan.startup.mode = 'earliest'
) ROW FORMAT DEBEZIUM_JSON;

statement ok
CREATE MATERIALIZED SOURCE tpcc_warehouse (
CREATE MATERIALIZED SOURCE warehouse (
w_id INTEGER,
w_name VARCHAR,
w_street_1 VARCHAR,
Expand All @@ -175,7 +175,7 @@ CREATE MATERIALIZED SOURCE tpcc_warehouse (
PRIMARY KEY (w_id)
) with (
connector = 'kafka',
topic = 'tpcc_warehouse',
topic = 'warehouse',
properties.bootstrap.server = '127.0.0.1:29092',
scan.startup.mode = 'earliest'
) ROW FORMAT DEBEZIUM_JSON;
18 changes: 9 additions & 9 deletions e2e_test/ch-benchmark/drop_sources.slt.part
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;
17 changes: 17 additions & 0 deletions e2e_test/ch-benchmark/q01.slt.part
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
22 changes: 22 additions & 0 deletions e2e_test/ch-benchmark/q02.slt.part
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
36 changes: 36 additions & 0 deletions e2e_test/ch-benchmark/q03.slt.part
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
23 changes: 23 additions & 0 deletions e2e_test/ch-benchmark/q04.slt.part
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
8 changes: 8 additions & 0 deletions e2e_test/ch-benchmark/q06.slt.part
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
Loading

0 comments on commit 180dc10

Please sign in to comment.