-
Notifications
You must be signed in to change notification settings - Fork 68
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
1 parent
59358da
commit 0863b10
Showing
6 changed files
with
84 additions
and
23 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,5 +1,16 @@ | ||
docker-compose -f test_compatibility/docker-compose.yaml up -d | ||
CUR_DIR="$GITHUB_WORKSPACE/tests/stream/test_compatibility" | ||
docker-compose -f "$CUR_DIR/configs/docker-compose.yaml" up -d | ||
sleep 5 | ||
docker exec proton-server proton client -nm -q "select x from example where _tp_time > earliest_ts() limit 3;" | ||
docker exec proton-server proton client -nm -q "select x from example_external limit 3 settings seek_to='earliest';" | ||
docker-compose -f test_compatibility/docker-compose.yaml down | ||
sqls=$(cat $CUR_DIR/basic_tests.sql | tr "\n" " " | sed 's/ \+/ /g') | ||
IFS="; | ||
" | ||
for sql in $sqls | ||
do | ||
if [ ${#sql} -gt 1 ] | ||
then | ||
echo "> [$sql]" | ||
timeout --foreground 30s docker exec proton-server proton client -nm -q "$sql" | ||
sleep 2 | ||
fi | ||
done | ||
docker-compose -f "$CUR_DIR/configs/docker-compose.yaml" down -v |
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,11 @@ | ||
select 'test 1'; | ||
insert into test_1_s (* except _tp_time) | ||
values | ||
(7, 1.1, 'g7', 47), (8, 2.1, 'h8', 48), (9, 3.1, 'i9', 49); | ||
select (* except _tp_time) from table(test_1_mv); | ||
select (* except _tp_time) from test_1_mv where _tp_time > earliest_ts() limit 9; | ||
|
||
select 'test 2'; | ||
insert into test_2_mv(* except _tp_time) values (0, 6.1); | ||
select (* except _tp_time) from table(test_2_mv); | ||
select (* except _tp_time) from test_2_mv where _tp_time > earliest_ts() limit 1; |
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,7 +1 @@ | ||
docker-compose -f test_compatibility/docker-compose.yaml up -d | ||
sleep 5 | ||
docker exec proton-server proton client -nm -q "insert into example (x) values (4)(5)(6);" | ||
docker exec proton-server proton client -nm -q "select x from example where _tp_time > earliest_ts() limit 6;" | ||
docker exec proton-server proton client -nm -q "insert into example_external (x) values (8)(10)(12);" | ||
docker exec proton-server proton client -nm -q "select x from example_external limit 6 settings seek_to='earliest';" | ||
docker-compose -f test_compatibility/docker-compose.yaml down | ||
CUR_DIR="$GITHUB_WORKSPACE/tests/stream/test_compatibility" |
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,8 +1,16 @@ | ||
docker-compose -f test_compatibility/docker-compose.yaml up -d | ||
CUR_DIR="$GITHUB_WORKSPACE/tests/stream/test_compatibility" | ||
echo $CUR_DIR | ||
docker-compose -f "$CUR_DIR/configs/docker-compose.yaml" up -d | ||
sleep 5 | ||
docker exec proton-server proton client -nm -q "create stream example(x int);" | ||
docker exec proton-server proton client -nm -q "insert into example (x) values (1)(2)(3);" | ||
docker exec redpanda rpk topic create example_topic | ||
docker exec proton-server proton client -nm -q "create external stream example_external (x int) settings type='kafka', brokers='stream-store:9092',topic='example_topic',data_format = 'JSONEachRow';" | ||
docker exec proton-server proton client -nm -q "insert into example_external (x) values (2)(4)(6);" | ||
docker-compose -f test_compatibility/docker-compose.yaml down | ||
sqls=$(cat $CUR_DIR/prepare_data.sql | tr "\n" " " | sed 's/ \+/ /g') | ||
IFS=";" | ||
for sql in $sqls | ||
do | ||
if [ ${#sql} -gt 1 ] | ||
then | ||
echo "> [$sql]" | ||
timeout --foreground 30s docker exec proton-server proton client -n -q "$sql;" | ||
sleep 2 | ||
fi | ||
done | ||
docker-compose -f "$CUR_DIR/configs/docker-compose.yaml" down -v |
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,37 @@ | ||
select 'test 1: a mv on stream, and then alter the stream add column'; | ||
create stream test_1_s ( | ||
col1 int, | ||
col2 float, | ||
col3 string | ||
); | ||
create materialized view test_1_mv as ( | ||
select | ||
col1, col2, col3 | ||
from | ||
test_1_s | ||
); | ||
insert into test_1_s (* except _tp_time) | ||
values | ||
(1, 1.1, 'a1'), (2, 2.1, 'b2'), (3, 3.1, 'c3'); | ||
|
||
alter stream test_1_s add column col4 uint64; | ||
|
||
insert into test_1_s (* except _tp_time) | ||
values | ||
(4, 4.1, 'd4', 44), (5, 5.1, 'e5', 45), (6, 6.1, 'f6', 46); | ||
|
||
select 'test 2 a mv on stream global aggregation'; | ||
create stream test_2_s ( | ||
col1 int, | ||
col2 float64 | ||
); | ||
create materialized view test_2_mv as( | ||
select | ||
min(col2) as min_col2, | ||
max(col2) as max_col2, | ||
count(col2) as cnt_col2 | ||
from test_2_s | ||
); | ||
insert into test_2_s (* except _tp_time) | ||
values | ||
(1, 1.1), (2, 2.1), (3, 3.1), (4, 4.1), (5, 5.1), (6, 6.1), (3, 3.1), (4, 4.1); |