system sh/stop_dnodes.sh system sh/deploy.sh -n dnode1 -m 192.168.0.1 -i 192.168.0.1 system sh/cfg.sh -n dnode1 -c commitLog -v 0 system sh/exec.sh -n dnode1 -s start sleep 3000 sql connect print ======================== dnode1 start $dbPrefix = t1_db $tbPrefix = t1_tb $mtPrefix = t1_mt $stPrefix = t1_st $tbNum = 10 $rowNum = 20 $totalNum = 200 print =============== step1 $i = 0 $db = $dbPrefix . $i $mt = $mtPrefix . $i $st = $stPrefix . $i sql drop databae $db -x step1 step1: sql create database $db sql use $db sql create table $mt (ts timestamp, tbcol int, tbcol2 float) TAGS(tgcol int) $i = 0 while $i < $tbNum $tb = $tbPrefix . $i sql create table $tb using $mt tags( $i ) $x = -1440 $y = 0 while $y < $rowNum $ms = $x . m sql insert into $tb values (now $ms , $y , $y ) $x = $x + 1 $y = $y + 1 endw $i = $i + 1 endw sleep 100 print =============== step2 c1 $i = 1 $tb = $tbPrefix . $i sql select count(*) from $tb interval(1d) print select count(*) from $tb interval(1d) ===> $data00 $data01 if $data01 != $rowNum then return -1 endi $st = $stPrefix . c1 sql create table $st as select count(*) from $tb interval(1d) print =============== step3 c2 sql select count(tbcol) from $tb interval(1d) print select count(tbcol) from $tb interval(1d) ===> $data00 $data01 if $data01 != $rowNum then return -1 endi $st = $stPrefix . c2 sql create table $st as select count(tbcol) from $tb interval(1d) print =============== step4 c3 sql select count(tbcol2) from $tb interval(1d) print select count(tbcol2) from $tb interval(1d) ===> $data00 $data01 if $data01 != $rowNum then return -1 endi $st = $stPrefix . c3 sql create table $st as select count(tbcol2) from $tb interval(1d) print =============== step5 avg sql select avg(tbcol) from $tb interval(1d) print select avg(tbcol) from $tb interval(1d) ===> $data00 $data01 if $data01 != 9.500000000 then return -1 endi $st = $stPrefix . av sql create table $st as select avg(tbcol) from $tb interval(1d) print =============== step6 su sql select sum(tbcol) from $tb interval(1d) print select sum(tbcol) from $tb interval(1d) ===> $data00 $data01 if $data01 != 190 then return -1 endi $st = $stPrefix . su sql create table $st as select sum(tbcol) from $tb interval(1d) print =============== step7 mi sql select min(tbcol) from $tb interval(1d) print select min(tbcol) from $tb interval(1d) ===> $data00 $data01 if $data01 != 0 then return -1 endi $st = $stPrefix . mi sql create table $st as select min(tbcol) from $tb interval(1d) print =============== step8 ma sql select max(tbcol) from $tb interval(1d) print select max(tbcol) from $tb interval(1d) ===> $data00 $data01 if $data01 != 19 then return -1 endi $st = $stPrefix . ma sql create table $st as select max(tbcol) from $tb interval(1d) print =============== step9 fi sql select first(tbcol) from $tb interval(1d) print select first(tbcol) from $tb interval(1d) ===> $data00 $data01 if $data01 != 0 then return -1 endi $st = $stPrefix . fi sql create table $st as select first(tbcol) from $tb interval(1d) print =============== step10 la sql select last(tbcol) from $tb interval(1d) print select last(tbcol) from $tb interval(1d) ===> $data00 $data01 if $data01 != 19 then return -1 endi $st = $stPrefix . la sql create table $st as select last(tbcol) from $tb interval(1d) print =============== step11 st sql select stddev(tbcol) from $tb interval(1d) print select stddev(tbcol) from $tb interval(1d) ===> $data00 $data01 if $data01 != 5.766281297 then return -1 endi $st = $stPrefix . std sql create table $st as select stddev(tbcol) from $tb interval(1d) print =============== step12 le sql select leastsquares(tbcol, 1, 1) from $tb interval(1d) print select leastsquares(tbcol, 1, 1) from $tb interval(1d) ===> $data00 $data01 #if $data01 != @(0.000017, -25362055.126740)@ then # return -1 #endi $st = $stPrefix . le sql create table $st as select leastsquares(tbcol, 1, 1) from $tb interval(1d) print =============== step13 sql select top(tbcol, 1) from $tb interval(1d) print =============== step14 sql select bottom(tbcol, 1) from $tb interval(1d) print =============== step15 pe sql select percentile(tbcol, 1) from $tb interval(1d) print select percentile(tbcol, 1) from $tb interval(1d) ===> $data00 $data01 if $data01 != 0.190000000 then return -1 endi $st = $stPrefix . pe sql create table $st as select percentile(tbcol, 1) from $tb interval(1d) print =============== step16 sql select diff(tbcol) from $tb interval(1d) -x step16 return -1 step16: print =============== step17 wh sql select count(tbcol) from $tb where ts < now + 4m interval(1d) print select count(tbcol) from $tb where ts < now + 4m interval(1d) ===> $data00 $data01 if $data01 != $rowNum then return -1 endi $st = $stPrefix . wh #sql create table $st as select count(tbcol) from $tb where ts < now + 4m interval(1d) print =============== step18 as sql select count(tbcol) from $tb interval(1d) print select count(tbcol) from $tb interval(1d) ===> $data00 $data01 if $data01 != $rowNum then return -1 endi $st = $stPrefix . as sql create table $st as select count(tbcol) as c from $tb interval(1d) print =============== step19 gb sql select count(tbcol) from $tb interval(1d) group by tgcol -x step19 return -1 step19: print =============== step20 x sql select count(tbcol) from $tb where ts < now + 4m interval(1d) group by tgcol -x step20 return -1 step20: print =============== step21 print sleep 22 seconds sleep 22000 print =============== step22 $st = $stPrefix . c1 sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != $rowNum then return -1 endi $st = $stPrefix . c2 sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != $rowNum then return -1 endi $st = $stPrefix . c3 sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != $rowNum then return -1 endi $st = $stPrefix . av sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != 9.500000000 then return -1 endi $st = $stPrefix . su sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != 190 then return -1 endi $st = $stPrefix . mi sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != 0 then return -1 endi $st = $stPrefix . ma sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != 19 then return -1 endi $st = $stPrefix . fi sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != 0 then return -1 endi $st = $stPrefix . la sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != 19 then return -1 endi $st = $stPrefix . std sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != 5.766281297 then return -1 endi $st = $stPrefix . le sql select * from $st #print ===> select * from $st ===> $data00 $data01 #if $data01 != @(0.000017, -25270086.331047)@ then # return -1 #endi $st = $stPrefix . pe sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != 0.190000000 then return -1 endi #$st = $stPrefix . wh #sql select * from $st #print ===> select * from $st ===> $data00 $data01 #if $data01 != $rowNum then # return -1 #endi $st = $stPrefix . as sql select * from $st print ===> select * from $st ===> $data00 $data01 if $data01 != $rowNum then return -1 endi