|
|
|
@ -216,6 +216,60 @@ sql insert into scalar_tb values (1656668180503+1s, -50, 50.1, "beiJing", "TDeng
|
|
|
|
|
print ========== step6 repeat
|
|
|
|
|
sql drop database test;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
print ========== interval\session\state window
|
|
|
|
|
|
|
|
|
|
sql CREATE DATABASE test1 BUFFER 96 CACHESIZE 1 CACHEMODEL 'none' COMP 2 DURATION 14400m WAL_FSYNC_PERIOD 3000 MAXROWS 4096 MINROWS 100 KEEP 5256000m,5256000m,5256000m PAGES 256 PAGESIZE 4 PRECISION 'ms' REPLICA 1 STRICT 'off' WAL_LEVEL 1 VGROUPS 2 SINGLE_STABLE 0;
|
|
|
|
|
sql use test1;
|
|
|
|
|
sql CREATE STABLE st (time TIMESTAMP, ca DOUBLE, cb DOUBLE, cc int) TAGS (ta VARCHAR(10) );
|
|
|
|
|
|
|
|
|
|
print ========== create table before stream
|
|
|
|
|
|
|
|
|
|
sql CREATE TABLE t1 using st TAGS ('aaa');
|
|
|
|
|
sql CREATE TABLE t2 using st TAGS ('bbb');
|
|
|
|
|
sql CREATE TABLE t3 using st TAGS ('ccc');
|
|
|
|
|
sql CREATE TABLE t4 using st TAGS ('ddd');
|
|
|
|
|
|
|
|
|
|
print ========== stable
|
|
|
|
|
|
|
|
|
|
sql create stream streamd1 into streamt1 as select ca, _wstart,_wend, count(*) as total from st where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ca interval(60m) fill(null);
|
|
|
|
|
sql create stream streamd2 into streamt2 as select ca, _wstart,_wend, count(*), max(ca), max(cb) from st where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ca interval(60m) fill(linear);
|
|
|
|
|
sql create stream streamd3 into streamt3 as select ca, _wstart,_wend, count(*) as total from st where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ca session(time, 60m);
|
|
|
|
|
sql create stream streamd4 into streamt4 as select ta, _wstart,_wend, count(*) as total from st where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ta session(time, 60m);
|
|
|
|
|
sql_error create stream streamd5 into streamt5 as select ca, _wstart,_wend, count(*) as total from st where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ca state_window(cc);
|
|
|
|
|
sql_error create stream streamd6 into streamt6 as select ta, _wstart,_wend, count(*) as total from st where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ta state_window(cc);
|
|
|
|
|
|
|
|
|
|
print ========== table
|
|
|
|
|
|
|
|
|
|
sql create stream streamd7 into streamt7 as select ca, _wstart,_wend, count(*) as total from t1 where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ca interval(60m) fill(null);
|
|
|
|
|
sql create stream streamd8 into streamt8 as select ca, _wstart,_wend, count(*), max(ca), max(cb) from t1 where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ca interval(60m) fill(linear);
|
|
|
|
|
sql create stream streamd9 into streamt9 as select ca, _wstart,_wend, count(*) as total from t1 where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ca session(time, 60m);
|
|
|
|
|
sql create stream streamd10 into streamt10 as select ta, _wstart,_wend, count(*) as total from t1 where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ta session(time, 60m);
|
|
|
|
|
sql create stream streamd11 into streamt11 as select ca, _wstart,_wend, count(*) as total from t1 where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ca state_window(cc);
|
|
|
|
|
sql create stream streamd12 into streamt12 as select ta, _wstart,_wend, count(*) as total from t1 where time > "2022-01-01 00:00:00" and time < "2032-01-01 00:00:00" partition by ta state_window(cc);
|
|
|
|
|
|
|
|
|
|
print ========== create table after stream
|
|
|
|
|
sql CREATE TABLE t5 using st TAGS ('eee');
|
|
|
|
|
sql CREATE TABLE t6 using st TAGS ('fff');
|
|
|
|
|
sql CREATE TABLE t7 using st TAGS ('ggg');
|
|
|
|
|
sql CREATE TABLE t8 using st TAGS ('fff');
|
|
|
|
|
|
|
|
|
|
sleep 1000
|
|
|
|
|
print ========== drop stream
|
|
|
|
|
sql drop stream if exists streamd1;
|
|
|
|
|
sql drop stream if exists streamd2;
|
|
|
|
|
sql drop stream if exists streamd3;
|
|
|
|
|
sql drop stream if exists streamd4;
|
|
|
|
|
#sql drop stream if exists streamd5;
|
|
|
|
|
#sql drop stream if exists streamd6;
|
|
|
|
|
sql drop stream if exists streamd7;
|
|
|
|
|
sql drop stream if exists streamd8;
|
|
|
|
|
sql drop stream if exists streamd9;
|
|
|
|
|
sql drop stream if exists streamd10;
|
|
|
|
|
sql drop stream if exists streamd11;
|
|
|
|
|
sql drop stream if exists streamd12;
|
|
|
|
|
print ========== step7
|
|
|
|
|
|
|
|
|
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
|
|
|
system sh/exec.sh -n dnode2 -s stop -x SIGINT
|
|
|
|
|
system sh/exec.sh -n dnode3 -s stop -x SIGINT
|
|
|
|
|