1006 lines
22 KiB
Plaintext
1006 lines
22 KiB
Plaintext
sql connect
|
|
sql use test0;
|
|
|
|
sql_error select a.col1, b.col1 from sta a left window join sta b on a.ts = b.ts and a.ts < '2023-11-17 16:29:02' and b.ts < '2023-11-17 16:29:01' window_offset(-1s, 1s) order by a.col1, b.col1;
|
|
sql_error select a.col1, b.col1 from sta a left window join sta b on a.ts = b.ts order by a.col1, b.col1;
|
|
sql_error select a.col1, b.col1 from sta a left window join sta b on a.ts = b.ts window_offset(-1s, 1s) order by a.col1, b.col1;
|
|
sql select a.col1, b.col1 from sta a left window join sta b window_offset(-1s, 1s) order by a.col1, b.col1;
|
|
if $rows != 28 then
|
|
return -1
|
|
endi
|
|
sql select a.col1, b.col1 from sta a left window join sta b window_offset(-1s, 1s) jlimit 2 order by a.col1, b.col1;
|
|
if $rows != 16 then
|
|
return -1
|
|
endi
|
|
sql select a.col1, b.col1 from sta a left window join sta b window_offset(1s, 1s) order by a.col1, b.col1;
|
|
if $rows != 9 then
|
|
return -1
|
|
endi
|
|
sql select a.col1, b.col1 from sta a left window join sta b window_offset(-1s, 1s) where a.ts < '2023-11-17 16:29:02' and b.ts < '2023-11-17 16:29:01' order by a.col1, b.col1;
|
|
if $rows != 6 then
|
|
return -1
|
|
endi
|
|
if $data00 != 1 then
|
|
return -1
|
|
endi
|
|
if $data01 != 1 then
|
|
return -1
|
|
endi
|
|
if $data10 != 1 then
|
|
return -1
|
|
endi
|
|
if $data11 != 2 then
|
|
return -1
|
|
endi
|
|
if $data20 != 2 then
|
|
return -1
|
|
endi
|
|
if $data21 != 1 then
|
|
return -1
|
|
endi
|
|
if $data30 != 2 then
|
|
return -1
|
|
endi
|
|
if $data31 != 2 then
|
|
return -1
|
|
endi
|
|
if $data40 != 3 then
|
|
return -1
|
|
endi
|
|
if $data41 != 1 then
|
|
return -1
|
|
endi
|
|
if $data50 != 3 then
|
|
return -1
|
|
endi
|
|
if $data51 != 2 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a left window join tba2 b window_offset(-1s, 1s)
|
|
if $rows != 7 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data40 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data41 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data50 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data51 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data60 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data61 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a left window join tba2 b window_offset(-1s, 1s) jlimit 1;
|
|
if $rows != 4 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a left window join tba2 b window_offset(-1a, 1a) jlimit 1;
|
|
if $rows != 4 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != NULL then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != NULL then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a left window join tba2 b window_offset(-1h, 1h);
|
|
if $rows != 16 then
|
|
return -1
|
|
endi
|
|
sql select a.ts, b.ts from tba1 a left window join tba2 b window_offset(1h, -1h);
|
|
if $rows != 16 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a left window join tba2 b window_offset(1a, -1h);
|
|
if $rows != 9 then
|
|
return -1
|
|
endi
|
|
|
|
sql select count(*) from sta a left window join sta b window_offset(-1s, 1s);
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != 3 then
|
|
return -1
|
|
endi
|
|
if $data10 != 3 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, count(*) from sta a left window join sta b window_offset(-1s, 1s);
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != 3 then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != 4 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, count(*) from sta a left window join sta b window_offset(-1s, 1s) where b.col1 between 2 and 4;
|
|
if $rows != 7 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != 2 then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != 3 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, count(*) from sta a left window join sta b window_offset(-1s, 1s) where b.col1 between 2 and 4 having(count(*) != 2);
|
|
if $rows != 3 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != 3 then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != 3 then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != 1 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, count(*) from sta a left window join sta b window_offset(-1s, 1s) where b.col1 between 2 and 4 having(count(*) != 2) order by count(*);
|
|
if $rows != 3 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != 1 then
|
|
return -1
|
|
endi
|
|
if $data11 != 3 then
|
|
return -1
|
|
endi
|
|
if $data21 != 3 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts from sta a left window join sta b window_offset(-1s, 1s) where b.col1 between 2 and 4 order by count(*);
|
|
if $rows != 7 then
|
|
return -1
|
|
endi
|
|
sql select a.ts from sta a left window join sta b window_offset(-1s, 1s) where b.col1 between 2 and 4 order by count(*), a.ts;
|
|
if $rows != 7 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data40 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data50 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data60 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, count(*),last(b.ts) from sta a left window join sta b window_offset(-1s, 1s);
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data02 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data12 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data22 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data32 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data40 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data42 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data50 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data52 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data60 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data62 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data70 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data72 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, count(*),last(b.ts) from sta a left window join sta b window_offset(-1s, 1s) limit 1;
|
|
if $rows != 1 then
|
|
return -1
|
|
endi
|
|
|
|
|
|
sql select timetruncate(a.ts, 1m), count(*) from sta a left window join sta b window_offset(-1s, 1s);
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != 3 then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != 4 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts+1s, count(*) from sta a left window join sta b window_offset(-1s, 1s);
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != 3 then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != 4 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b on a.col1=b.col1 window_offset(-1s, 1s) order by a.col1, a.ts;
|
|
if $rows != 12 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b on a.t1=b.t1 window_offset(-1s, 1s) order by a.t1, a.ts, b.ts;
|
|
if $rows != 14 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data40 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data41 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data50 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data51 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data60 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data61 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data70 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data71 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data80 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data81 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data90 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data91 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b on a.t1=b.t1 and a.col1=b.col1 window_offset(-1s, 1s) order by a.t1, a.ts, b.ts;
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data40 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data41 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data50 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data51 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data60 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data61 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data70 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data71 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b on a.t1=b.t1 and a.col1=b.col1 window_offset(-2s, -1s) order by a.t1, a.ts, b.ts;
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != NULL then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != NULL then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != NULL then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != NULL then
|
|
return -1
|
|
endi
|
|
if $data40 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data41 != NULL then
|
|
return -1
|
|
endi
|
|
if $data50 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data51 != NULL then
|
|
return -1
|
|
endi
|
|
if $data60 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data61 != NULL then
|
|
return -1
|
|
endi
|
|
if $data70 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data71 != NULL then
|
|
return -1
|
|
endi
|
|
|
|
sql SELECT a.ts, count(b.*) FROM tba1 a LEFT WINDOW JOIN tba2 b ON a.col1 = b.col1 WINDOW_OFFSET(-1s, 1s) where a.col1 > 1 order by a.ts;
|
|
if $rows != 3 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != 1 then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != 0 then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != 1 then
|
|
return -1
|
|
endi
|
|
|
|
sql SELECT a.ts, count(b.*) FROM tba1 a LEFT WINDOW JOIN tba2 b ON a.col1 = b.col1 WINDOW_OFFSET(-1s, 1s) order by a.col1;
|
|
if $rows != 4 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != 0 then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != 1 then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != 0 then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != 1 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b window_offset(-2s, -1s) order by a.ts desc;
|
|
if $rows != 17 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
sql select a.ts, b.ts from sta a left window join sta b window_offset(-2s, -1s) jlimit 1 order by a.ts desc;
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b window_offset(-2s, -1s) jlimit 1;
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data50 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data51 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data60 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data61 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data70 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data71 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b window_offset(0s, 0s) order by a.ts desc;
|
|
if $rows != 12 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b window_offset(-1s, 1s) order by a.ts desc;
|
|
if $rows != 28 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b window_offset(1s, 2s) order by a.ts desc;
|
|
if $rows != 16 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != NULL then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
sql select a.ts, b.ts from sta a left window join sta b window_offset(1s, 2s) jlimit 1 order by a.ts desc;
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != NULL then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b window_offset(1s, 2s) order by b.ts desc;
|
|
if $rows != 16 then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data41 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data51 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
sql select a.ts, b.ts from sta a left window join sta b window_offset(1s, 2s) order by b.ts;
|
|
if $rows != 16 then
|
|
return -1
|
|
endi
|
|
if $data01 != NULL then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data41 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data51 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from sta a left window join sta b on a.t1=b.t1 window_offset(-2s, -1s) order by a.ts desc, b.ts;
|
|
if $rows != 9 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
sql select a.ts, b.ts from sta a left window join sta b on a.t1=b.t1 window_offset(0s, 0s) order by a.ts desc;
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
sql select a.ts, b.ts from sta a left window join sta b on a.t1=b.t1 window_offset(-1s, 1s) order by a.ts desc, b.ts desc;
|
|
if $rows != 14 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
sql select a.ts, b.ts from sta a left window join sta b on a.t1=b.t1 window_offset(1s, 2s) order by a.ts desc, b.ts desc;
|
|
if $rows != 9 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data01 != NULL then
|
|
return -1
|
|
endi
|
|
if $data10 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data11 != NULL then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data21 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != @23-11-17 16:29:04.000@ then
|
|
return -1
|
|
endi
|
|
sql select count(*) from sta a left window join sta b on a.t1=b.t1 window_offset(1s, 2s) order by a.ts desc;
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != 1 then
|
|
return -1
|
|
endi
|
|
if $data10 != 1 then
|
|
return -1
|
|
endi
|
|
if $data20 != 1 then
|
|
return -1
|
|
endi
|
|
if $data30 != 1 then
|
|
return -1
|
|
endi
|
|
if $data40 != 2 then
|
|
return -1
|
|
endi
|
|
if $data50 != 1 then
|
|
return -1
|
|
endi
|
|
if $data60 != 1 then
|
|
return -1
|
|
endi
|
|
if $data70 != 1 then
|
|
return -1
|
|
endi
|
|
sql select count(b.ts) from sta a left window join sta b on a.t1=b.t1 window_offset(1s, 2s) order by a.ts desc;
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
if $data00 != 0 then
|
|
return -1
|
|
endi
|
|
if $data10 != 0 then
|
|
return -1
|
|
endi
|
|
if $data20 != 1 then
|
|
return -1
|
|
endi
|
|
if $data30 != 1 then
|
|
return -1
|
|
endi
|
|
if $data40 != 2 then
|
|
return -1
|
|
endi
|
|
if $data50 != 1 then
|
|
return -1
|
|
endi
|
|
if $data60 != 1 then
|
|
return -1
|
|
endi
|
|
if $data70 != 1 then
|
|
return -1
|
|
endi
|
|
sql select a.col1, count(*) from sta a left window join sta b window_offset(-1s, 1s);
|
|
if $rows != 8 then
|
|
return -1
|
|
endi
|
|
|
|
sql_error select b.col1, count(*) from sta a left window join sta b window_offset(-1s, 1s);
|
|
sql_error select b.ts, count(*) from sta a left window join sta b window_offset(-1s, 1s);
|
|
sql_error select a.ts, b.ts from sta a left window join sta b window_offset(-1s, 1s) having(b.ts > 0);
|
|
sql_error select a.ts, b.ts from sta a left window join sta b window_offset(-1s, 1s) having(a.col1 > 0);
|
|
sql_error select a.ts, b.ts from sta a left window join sta b window_offset(-1s, 1s) having(a.col1 > 0);
|
|
sql_error select a.ts, b.ts from sta a left window join sta b window_offset(-1s, 1s) having(a.ts > "2023-11-17 16:29:00.000");
|
|
sql_error select a.ts from sta a left window join sta b window_offset(-1s, 1s) where b.col1 between 2 and 4 having(a.ts > 0) order by count(*);
|
|
sql_error select a.ts, count(*),last(b.ts) from sta a left window join sta b window_offset(-1s, 1s) slimit 1;
|
|
sql_error select a.ts, b.ts from sta a left window join sta b on a.t1=1 window_offset(-1s, 1s) order by a.t1, a.ts;
|
|
sql_error select a.ts, b.ts from sta a left window join sta b on a.ts > 1 window_offset(-1s, 1s) where a.ts = b.ts;
|
|
sql_error select a.ts, b.ts from sta a left window join sta b on a.ts =b.ts window_offset(-1s, 1s) where a.ts = b.ts;
|
|
sql_error select a.ts, b.ts from sta a left window join sta b window_offset(-1, 1) where a.ts = b.ts;
|
|
sql_error select a.ts, b.ts from (select * from sta) a left window join sta b window_offset(-1s, 1s) where a.ts = b.ts;
|
|
sql_error select a.ts, b.ts from tba1 a left window join tba2 b window_offset(-10a, 1a) jlimit 1025;
|