checkStreamSTable1.sim 1.6 KB
Newer Older
5
54liuyao 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1

print ===== step1

system sh/exec.sh -n dnode1 -s start 
sleep 50
sql connect

print ===== step2

sql create database test  vgroups 4;
sql use test;
sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create stream streams1 trigger at_once  into streamt1 as select  _wstart, count(*) c1, count(a) c2  from st interval(1s) ;
sql insert into t1 values(1648791211000,1,2,3);
sql insert into t1 values(1648791212000,2,2,3);

$loop_count = 0
loop0:

5
54liuyao 已提交
24
sleep 1000
5
54liuyao 已提交
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53

$loop_count = $loop_count + 1
if $loop_count == 10 then
  return -1
endi

print 1 select * from streamt1;
sql select * from streamt1;

if $rows != 2 then
   print rows=$rows
   goto loop0
endi

print drop stream streams1
sql drop stream streams1;

print alter table streamt1 add column c3 double
sql alter table streamt1 add column c3 double;

print create stream streams1 trigger at_once  into streamt1 as select  _wstart, count(*) c1, count(a) c2, avg(b) c3  from st interval(1s) ;
sql create stream streams1 trigger at_once  into streamt1 as select  _wstart, count(*) c1, count(a) c2, avg(b) c3  from st interval(1s) ;

sql insert into t2 values(1648791213000,1,2,3);
sql insert into t1 values(1648791214000,1,2,3);

$loop_count = 0
loop1:

5
54liuyao 已提交
54
sleep 1000
5
54liuyao 已提交
55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71

$loop_count = $loop_count + 1
if $loop_count == 10 then
  return -1
endi

print 2 select * from streamt1;
sql select * from streamt1;

if $rows != 4 then
   print rows=$rows
   goto loop1
endi

print ======over

system sh/stop_dnodes.sh