sql select count(*) from sliding_tb0 interval(30s) sliding(30s);
sql select _wstart, count(*) from sliding_tb0 interval(30s) sliding(30s);
if $row != 10 then
return -1
endi
if $data00 != @00-01-01 00:00:00.000@ then
return -1
endi
if $data01 != 1000 then
return -1
endi
if $data10 != @00-01-01 00:00:30.000@ then
return -1
endi
if $data11 != 1000 then
return -1
endi
sql select stddev(c1) from sliding_tb0 interval(10a) sliding(10a)
sql select _wstart, stddev(c1) from sliding_tb0 interval(10a) sliding(10a);
if $row != 10000 then
return -1
endi
if $data00 != @00-01-01 00:00:00.000@ then
return -1
endi
if $data01 != 0.000000000 then
return -1
endi
if $data90 != @00-01-01 00:00:00.270@ then
return -1
endi
if $data91 != 0.000000000 then
return -1
endi
sql select stddev(c1),count(c2),first(c3),last(c4) from sliding_tb0 interval(10a) sliding(10a) order by ts desc;
sql select _wstart, stddev(c1),count(c2),first(c3),last(c4) from sliding_tb0 interval(10a) sliding(10a) order by _wstart desc;
if $row != 10000 then
return -1
endi
if $data00 != @00-01-01 00:04:59.970@ then
return -1
endi
if $data01 != 0.000000000 then
return -1
endi
if $data02 != 1 then
return -1
endi
if $data03 != 99 then
return -1
endi
if $data04 != 99 then
return -1
endi
if $data90 != @00-01-01 00:04:59.700@ then
return -1
endi
if $data91 != 0.000000000 then
return -1
endi
if $data92 != 1 then
return -1
endi
if $data93 != 90 then
return -1
endi
if $data94 != 90 then
return -1
endi
sql select count(c2),last(c4) from sliding_tb0 interval(30s) sliding(10s) order by ts asc;
sql select _wstart, count(c2),last(c4) from sliding_tb0 interval(30s) sliding(10s) order by _wstart asc;
if $row != 32 then
return -1
endi
if $data00 != @99-12-31 23:59:40.000@ then
print expect 12-31 23:59:40.000, actual: $data00
return -1
endi
if $data01 != 334 then
return -1
endi
if $data02 != 33 then
return -1
endi
sql select count(c2),stddev(c3),first(c4),last(c4) from sliding_tb0 where ts>'2000-01-01 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by ts asc;
sql select _wstart, count(c2),stddev(c3),first(c4),last(c4) from sliding_tb0 where ts>'2000-01-01 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by _wstart asc;
if $row != 2 then
return -1
endi
if $data04 != 99 then
return -1
endi
if $data01 != 999 then
return -1
endi
if $data02 != 28.837977152 then
return -1
endi
#interval offset + limit
sql select count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) sliding(10a) order by ts desc limit 10 offset 990;
sql select _wstart, count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) sliding(10a) order by _wstart desc limit 10 offset 990;
if $row != 10 then
return -1
endi
if $data00 != @00-01-01 00:04:30.270@ then
return -1
endi
if $data01 != 1 then
return -1
endi
if $data02 != 9 then
return -1
endi
if $data03 != 0.000000000 then
return -1
endi
if $data90 != @00-01-01 00:04:30.000@ then
return -1
endi
if $data91 != 1 then
return -1
endi
if $data92 != 0 then
return -1
endi
if $data93 != 0.000000000 then
return -1
endi
#interval offset test
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(30s) order by ts asc limit 1000 offset 1;
sql select _wstart, count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(30s) order by _wstart asc limit 1000 offset 1;
if $row != 9 then
return -1
endi
if $data00 != @00-01-01 00:00:30.000@ then
return -1
endi
if $data01 != 1000 then
return -1
endi
if $data02 != 99 then
return -1
endi
if $data80 != @00-01-01 00:04:30.000@ then
return -1
endi
if $data81 != 1000 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 where ts>'2000-1-1 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by ts asc limit 1000 offset 0;
sql select _wstart, count(c2),last(c4),stddev(c3) from sliding_tb0 where ts>'2000-1-1 0:0:0' and ts<'2000-1-1 0:0:31' interval(30s) sliding(30s) order by _wstart asc limit 1000 offset 0;
if $row != 2 then
return -1
endi
if $data00 != @00-01-01 00:00:00.000@ then
return -1
endi
if $data01 != 999 then
return -1
endi
if $data02 != 99 then
return -1
endi
if $data03 != 28.837977152 then
return -1
endi
if $data10 != @00-01-01 00:00:30.000@ then
return -1
endi
if $data11 != 34 then
return -1
endi
if $data12 != 33 then
return -1
endi
if $data13 != 9.810708435 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 1;
sql select _wstart, count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 1;
if $row != 15 then
return -1
endi
if $data00 != @00-01-01 00:00:00.000@ then
return -1
endi
if $data01 != 1000 then
return -1
endi
if $data02 != 99 then
return -1
endi
if $data03 != 28.866070048 then
return -1
endi
if $data90 != @00-01-01 00:03:00.000@ then
return -1
endi
if $data91 != 1000 then
return -1
endi
if $data92 != 99 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 5;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 5;
if $row != 11 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 6;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 6;
if $row != 10 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 7;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 7;
if $row != 9 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 8;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 8;
if $row != 8 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 9;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 9;
if $row != 7 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 10;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 10;
if $row != 6 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 11;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 11;
if $row != 5 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 12;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 12;
if $row != 4 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 13;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 13;
if $row != 3 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 14;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 14;
if $row != 2 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 15;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 15;
if $row != 1 then
return -1
endi
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by ts asc limit 100 offset 16;
sql select count(c2),last(c4),stddev(c3) from sliding_tb0 interval(30s) sliding(20s) order by _wstart asc limit 100 offset 16;
if $row != 0 then
return -1
endi
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) order by ts desc;
sql select _wstart, count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) order by _wstart desc;
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by ts desc limit 1 offset 15;
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by _wstart desc limit 1 offset 15;
if $row != 1 then
return -1
endi
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by ts desc limit 1 offset 16;
sql select count(c2),last(c4),stddev(c3),spread(c3) from sliding_tb0 where c2 = 0 interval(30s) sliding(20s) order by _wstart desc limit 1 offset 16;
if $row != 0 then
return -1
endi
sql select count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) order by ts desc limit 10 offset 2;
sql select _wstart, count(c2), first(c3),stddev(c4) from sliding_tb0 interval(10a) order by _wstart desc limit 10 offset 2;
if $data00 != @00-01-01 00:04:59.910@ then
return -1
endi
sql select count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by ts asc limit 1000;
sql select _wstart, count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by _wstart asc limit 1000;
if $row != 3 then
return -1
endi
if $data00 != @99-12-31 23:59:40.000@ then
return -1
endi
if $data02 != 9.521904571 then
return -1
endi
if $data05 != 33 then
return -1
endi
if $data10 != @99-12-31 23:59:50.000@ then
return -1
endi
if $data12 != 9.521904571 then
return -1
endi
if $data15 != 33 then
return -1
endi
if $data25 != 33 then
return -1
endi
sql select count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by ts desc limit 1000;
sql select _wstart, count(*),stddev(c1),count(c1),first(c2),last(c3) from sliding_tb0 where ts>'2000-1-1 00:00:00' and ts<'2000-1-1 00:00:01.002' and c2 >= 0 interval(30s) sliding(10s) order by _wstart desc limit 1000;