mirror of
https://github.com/taosdata/TDengine
synced 2026-05-24 10:09:01 +00:00
147 lines
4.3 KiB
Text
147 lines
4.3 KiB
Text
system sh/stop_dnodes.sh
|
|
system sh/deploy.sh -n dnode1 -i 1
|
|
system sh/exec.sh -n dnode1 -s start
|
|
sql connect
|
|
|
|
print =============== failed to create anode on '127.0.0.1:1101'
|
|
sql_error create anode '127.0.0.1:1101'
|
|
|
|
sql show anodes
|
|
if $rows != 0 then
|
|
return -1
|
|
endi
|
|
|
|
sql_error drop anode 1
|
|
|
|
print ================ create anode
|
|
sql create anode '192.168.1.116:6050'
|
|
|
|
sql show anodes
|
|
if $rows != 1 then
|
|
return -1
|
|
endi
|
|
|
|
print =============== show info
|
|
sql show anodes full
|
|
if $rows != 8 then
|
|
print expect 8 , actual $rows
|
|
return -1
|
|
endi
|
|
|
|
print =============== create database
|
|
sql create database d0 vgroups 1
|
|
sql select * from information_schema.ins_databases
|
|
if $rows != 3 then
|
|
return -1
|
|
endi
|
|
|
|
print $data00 $data01 $data02
|
|
|
|
sql use d0
|
|
|
|
print =============== create super table, include column type for count/sum/min/max/first
|
|
sql create table if not exists stb (ts timestamp, c1 int, c2 float, c3 double) tags (t1 int unsigned)
|
|
|
|
sql show stables
|
|
if $rows != 1 then
|
|
return -1
|
|
endi
|
|
|
|
print =============== create child table
|
|
sql create table ct1 using stb tags(1000)
|
|
|
|
print ==================== insert data
|
|
# input_list = [5, 14, 15, 15, 14, 19, 17, 16, 20, 22, 8, 21, 28, 11, 9, 29, 40]
|
|
sql insert into ct1(ts, c1) values(now-1a, 5)(now+1a, 14)(now+2a, 15)(now+3a, 15)(now+4a, 14)
|
|
sql insert into ct1(ts, c1) values(now+5a, 19)(now+6a, 17)(now+7a, 16)(now+8a, 20)(now+9a, 22)
|
|
sql insert into ct1(ts, c1) values(now+10a, 8)(now+11a, 21)(now+12a, 28)(now+13a, 11)(now+14a, 9)
|
|
sql insert into ct1(ts, c1) values(now+15a, 29)(now+16a, 40)
|
|
|
|
sql select count(*) from ct1
|
|
if $data00 != 17 then
|
|
print expect 17 , actual $data00
|
|
return -1
|
|
endi
|
|
|
|
sql select count(*) from ct1 anomaly_window(c1, 'algo=iqr')
|
|
if $data00 != 1 then
|
|
return -1
|
|
endi
|
|
|
|
sql_error select _frowts, _flow, _fhigh, forecast(c1, 'algo=holtwinters,conf=0.5,wncheck=1,period=0') from ct1
|
|
sql_error select _frowts, _flow, _fhigh, forecast(c1, 'algo=holtwinters,conf=119,wncheck=1,period=0') from ct1
|
|
sql_error select _frowts, _flow, _fhigh, forecast(c1, 'algo=holtwinters1,conf=0.5,wncheck=1,period=0') from ct1
|
|
sql_error select forecast(c1, 'conf=50 ,algo = arima, rows=0') from ct1
|
|
sql_error select forecast(c1, 'conf=50 ,algo = arima, rows=-10') from ct1
|
|
sql_error select forecast(c1, 'conf=50 ,algo = arima, every=0') from ct1
|
|
|
|
sql select _frowts, _flow, _fhigh, forecast(c1, 'algo=holtwinters, conf=50 ') from ct1
|
|
sql select _frowts, _flow, _fhigh, forecast(c1, ' algo=holtwinters , conf=50 ') from ct1
|
|
sql select _frowts, _flow, _fhigh, forecast(c1, ' algo = holtwinters , conf = 50 ') from ct1
|
|
sql select _frowts, _flow, _fhigh, forecast(c1, 'conf=50 ,algo = holtwinters, ') from ct1
|
|
sql select _frowts, _flow, _fhigh, forecast(c1, 'conf=50 ,algo = holtwinters, ,') from ct1
|
|
sql select _frowts, _flow, _fhigh, forecast(c1, 'conf=50 ,algo = holtwinters, , ,') from ct1
|
|
sql select _frowts, _flow, _fhigh, forecast(c1, 'conf=50 ,algo = holtwinters, a =') from ct1
|
|
sql select _frowts, _flow, _fhigh, forecast(c1, 'conf=50 ,algo = holtwinters, = a ,') from ct1
|
|
sql select forecast(c1, 'conf=50 ,algo = arima') from ct1
|
|
sql select forecast(c1, 'conf=50 ,algo = arima, rows=1') from ct1
|
|
|
|
sql select _frowts, _flow, _fhigh, forecast(c1, 'algo=holtwinters,conf=50,wncheck=1,period=0,start=1700000000000,every=2') from ct1
|
|
if $rows != 10 then
|
|
return -1
|
|
endi
|
|
|
|
if $data03 != 28 then
|
|
return -1
|
|
endi
|
|
|
|
if $data00 != @23-11-15 06:13:20.000@ then
|
|
print expect 23-11-15 06:13:20.000 , actual $data00
|
|
return -1
|
|
endi
|
|
|
|
if $data10 != @23-11-15 06:13:20.002@ then
|
|
print expect 23-11-15 06:13:20.002 , actual $data10
|
|
return -1
|
|
endi
|
|
|
|
if $data20 != @23-11-15 06:13:20.004@ then
|
|
return -1
|
|
endi
|
|
|
|
print test the every option and rows option
|
|
|
|
sql select _frowts, _flow, _fhigh, forecast(c1, 'algo=holtwinters,conf=50,wncheck=1,period=0,start=1700000000000,every=100,rows=5') from ct1
|
|
if $rows != 5 then
|
|
return -1
|
|
endi
|
|
|
|
if $data00 != @23-11-15 06:13:20.000@ then
|
|
return -1
|
|
endi
|
|
|
|
if $data10 != @23-11-15 06:13:20.100@ then
|
|
return -1
|
|
endi
|
|
|
|
sql drop anode 1
|
|
sql show anodes
|
|
|
|
if $rows != 0 then
|
|
return -1
|
|
endi
|
|
|
|
_OVER:
|
|
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
|
print =============== check
|
|
$null=
|
|
|
|
system_content sh/checkValgrind.sh -n dnode1
|
|
print cmd return result ----> [ $system_content ]
|
|
if $system_content > 0 then
|
|
return -1
|
|
endi
|
|
|
|
if $system_content == $null then
|
|
return -1
|
|
endi
|