Skip to content

Commit

Permalink
test: support streaming queries for CH-Benchmark (risingwavelabs#6568)
Browse files Browse the repository at this point in the history
  • Loading branch information
lmatz authored Nov 28, 2022
1 parent 93f59d9 commit 6b3177a
Show file tree
Hide file tree
Showing 63 changed files with 2,138 additions and 17 deletions.
3 changes: 2 additions & 1 deletion ci/scripts/e2e-source-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,4 +77,5 @@ cargo run --bin prepare_ci_pubsub
sqllogictest -p 4566 -d dev './e2e_test/source/basic/*.slt'

echo "--- Run CH-benCHmark"
./risedev slt -p 4566 -d dev ./e2e_test/ch-benchmark/ch_benchmark.slt
./risedev slt -p 4566 -d dev './e2e_test/ch_benchmark/batch/ch_benchmark.slt'
./risedev slt -p 4566 -d dev './e2e_test/ch_benchmark/streaming/*.slt'
2 changes: 1 addition & 1 deletion ci/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ steps:
config: ci/docker-compose.yml
mount-buildkite-agent: true
- ./ci/plugins/upload-failure-logs
timeout_in_minutes: 10
timeout_in_minutes: 12
retry: *auto-retry

- label: "end-to-end test (parallel)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
statement ok
SET RW_IMPLICIT_FLUSH TO true;

statement ok
SET QUERY_MODE TO distributed;

# Create tpch tables
include ../tpch/create_tables.slt.part
include ../../tpch/create_tables.slt.part

# Drop unneeded tables
statement ok
Expand All @@ -18,27 +24,27 @@ 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
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
include ../create_sources.slt.part

# Ensure that the upstream data is fully consumed
statement ok
flush;

# 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 ./q1.slt.part
include ./q2.slt.part
include ./q3.slt.part
include ./q4.slt.part
# include ./q5.slt.part --> no output
include ./q6.slt.part
# include ./q7.slt.part --> no output
# include ./q8.slt.part --> no output
include ./q9.slt.part
include ./q10.slt.part
include ./q11.slt.part
include ./q12.slt.part
Expand All @@ -53,7 +59,7 @@ include ./q20.slt.part
include ./q21.slt.part
include ./q22.slt.part

include ./drop_sources.slt.part
include ../drop_sources.slt.part

# Drop tpch tables
statement ok
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
67 changes: 67 additions & 0 deletions e2e_test/ch_benchmark/streaming/ch_benchmark_snapshot.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
statement ok
SET RW_IMPLICIT_FLUSH TO true;

# 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

# Then, create materialized views based on the historical data (snapshot)
include ./create_views.slt.part

# Test each query
include ./q1.slt.part
include ./q2.slt.part
include ./q3.slt.part
include ./q4.slt.part
include ./q6.slt.part
include ./q9.slt.part
include ./q10.slt.part
include ./q11.slt.part
include ./q12.slt.part
include ./q13.slt.part
include ./q14.slt.part
include ./q15.slt.part
include ./q16.slt.part
include ./q17.slt.part
include ./q18.slt.part
include ./q20.slt.part
include ./q21.slt.part
include ./q22.slt.part


include ./drop_views.slt.part

include ../drop_sources.slt.part

# Drop tpch tables
statement ok
DROP TABLE supplier;

statement ok
DROP TABLE region;

statement ok
DROP TABLE nation;
66 changes: 66 additions & 0 deletions e2e_test/ch_benchmark/streaming/ch_benchmark_upstream.slt
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
statement ok
SET RW_IMPLICIT_FLUSH TO true;

# 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;

include ../create_sources.slt.part

# First, create materialized views
include ./create_views.slt.part

# Then, insert data to tpch tables (upstream)
include ../../tpch/insert_nation.slt.part
include ../../tpch/insert_region.slt.part
include ../../tpch/insert_supplier.slt.part

# Test each query
include ./q1.slt.part
include ./q2.slt.part
include ./q3.slt.part
include ./q4.slt.part
include ./q6.slt.part
include ./q9.slt.part
include ./q10.slt.part
include ./q11.slt.part
include ./q12.slt.part
include ./q13.slt.part
include ./q14.slt.part
include ./q15.slt.part
include ./q16.slt.part
include ./q17.slt.part
include ./q18.slt.part
include ./q20.slt.part
include ./q21.slt.part
include ./q22.slt.part


include ./drop_views.slt.part

include ../drop_sources.slt.part

# Drop tpch tables
statement ok
DROP TABLE supplier;

statement ok
DROP TABLE region;

statement ok
DROP TABLE nation;
18 changes: 18 additions & 0 deletions e2e_test/ch_benchmark/streaming/create_views.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
include ./views/q1.slt.part
include ./views/q2.slt.part
include ./views/q3.slt.part
include ./views/q4.slt.part
include ./views/q6.slt.part
include ./views/q9.slt.part
include ./views/q10.slt.part
include ./views/q11.slt.part
include ./views/q12.slt.part
include ./views/q13.slt.part
include ./views/q14.slt.part
include ./views/q15.slt.part
include ./views/q16.slt.part
include ./views/q17.slt.part
include ./views/q18.slt.part
include ./views/q20.slt.part
include ./views/q21.slt.part
include ./views/q22.slt.part
53 changes: 53 additions & 0 deletions e2e_test/ch_benchmark/streaming/drop_views.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
statement ok
drop materialized view ch_benchmark_q1;

statement ok
drop materialized view ch_benchmark_q2;

statement ok
drop materialized view ch_benchmark_q3;

statement ok
drop materialized view ch_benchmark_q4;

statement ok
drop materialized view ch_benchmark_q6;

statement ok
drop materialized view ch_benchmark_q9;

statement ok
drop materialized view ch_benchmark_q10;

statement ok
drop materialized view ch_benchmark_q11;

statement ok
drop materialized view ch_benchmark_q12;

statement ok
drop materialized view ch_benchmark_q13;

statement ok
drop materialized view ch_benchmark_q14;

statement ok
drop materialized view ch_benchmark_q15;

statement ok
drop materialized view ch_benchmark_q16;

statement ok
drop materialized view ch_benchmark_q17;

statement ok
drop materialized view ch_benchmark_q18;

statement ok
drop materialized view ch_benchmark_q20;

statement ok
drop materialized view ch_benchmark_q21;

statement ok
drop materialized view ch_benchmark_q22;
9 changes: 9 additions & 0 deletions e2e_test/ch_benchmark/streaming/q1.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
query IIIIII rowsort
select * from ch_benchmark_q1;
----
1 600 84 5 0.7 120
2 550 0.0 5 0.0 110
3 560 14739 5.1 134.0 110
4 550 44.1 5 0.4 110
5 550 0.0 5 0.0 110
6 200 0.0 5 0.0 40
23 changes: 23 additions & 0 deletions e2e_test/ch_benchmark/streaming/q10.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
query ITRTTT rowsort
select * from ch_benchmark_q10;
----
9 BARBARATION 998 Bgyigg02R06By 766-299-8660 BRAZIL
8 BARBARCALLY 543 wLyBmkikB2044 908-531-5952 PERU
9 BARBARATION 132.42 iiw0Bg2PPBR 42k iw 513-596-8472 ALGERIA
9 BARBARATION 21 2P6wNkN24NgP 912-655-1882 PERU
10 BARBAREING 21 wLm0 iPyNkmNPmwmB 993-592-8926 BRAZIL
7 BARBARANTI 0 NRPB2B P 0BBw20yRN 746-634-7967 PERU
7 BARBARANTI 0 L00wi2iB2R Lw LP2 254-684-5865 EGYPT
10 BARBAREING 0 26PP6i0y20yiP4PLmNyP 897-842-8196 PERU
8 BARBARCALLY 0 wPw2BP6RRkPk PBL42 517-371-7996 PERU
6 BARBARESE 0 Big igy RyLR 702-728-7110 EGYPT
8 BARBARCALLY 0 0LiiPPwggy 415-587-9162 BRAZIL
10 BARBAREING 0 yLk444 LB Rk 222BL 910-889-6085 EGYPT
7 BARBARANTI 0 i6By BL wmk R 228-534-4528 PERU
9 BARBARATION 0 wBNy20gmNiLP kymBR0 121-143-7689 PERU
7 BARBARANTI 0 46R4Rg PBBw 207-246-2175 EGYPT
7 BARBARANTI 0 PgN2y 422Lw gP 714-875-8566 FRANCE
9 BARBARATION 0 L06gN 6BBBLikkwg2mw2 410-137-9683 BRAZIL
8 BARBARCALLY 0 N6yNyL6RmBgLkwRRw4 218-218-7646 PERU
8 BARBARCALLY 0 Lw2kykmRN2kgiR2P6w0R 186-295-3252 PERU
6 BARBARESE 0 w06kwPywyLw44y 816-833-4268 PERU
4 changes: 4 additions & 0 deletions e2e_test/ch_benchmark/streaming/q11.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
query II rowsort
select * from ch_benchmark_q11;
----
11 42
11 changes: 11 additions & 0 deletions e2e_test/ch_benchmark/streaming/q12.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
query III rowsort
select * from ch_benchmark_q12;
----
6 20 50
7 30 40
8 20 66
9 46 47
10 0 48
11 0 49
12 11 17
13 6 0
8 changes: 8 additions & 0 deletions e2e_test/ch_benchmark/streaming/q13.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
query II rowsort
select * from ch_benchmark_q13;
----
2 4
0 4
7 1
3 1
1 1
4 changes: 4 additions & 0 deletions e2e_test/ch_benchmark/streaming/q14.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
query R rowsort
select * from ch_benchmark_q14;
----
99.9812030075188
4 changes: 4 additions & 0 deletions e2e_test/ch_benchmark/streaming/q15.slt.part
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
query ITTTR rowsort
select * from ch_benchmark_q15;
----
5 Supplier#000000005 Gcdm2rJRzl5qlTVzc 21-151-690-3663 14739
Loading

0 comments on commit 6b3177a

Please sign in to comment.