277 lines
6.0 KiB
Plaintext
277 lines
6.0 KiB
Plaintext
sql connect
|
|
sql use test0;
|
|
|
|
sql_error select a.col1, b.col1 from sta a right 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 right 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 right 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 right 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 right 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 right 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 right 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 right 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 right window join tba2 b window_offset(-1s, 1s) order by b.ts desc;
|
|
if $rows != 7 then
|
|
return -1
|
|
endi
|
|
if $data01 != @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 $data21 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data31 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data41 != @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 $data61 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a right window join tba2 b window_offset(-1s, 1s) order by a.ts desc;
|
|
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:04.000@ then
|
|
return -1
|
|
endi
|
|
if $data20 != @23-11-17 16:29:03.000@ then
|
|
return -1
|
|
endi
|
|
if $data30 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data40 != @23-11-17 16:29:02.000@ then
|
|
return -1
|
|
endi
|
|
if $data50 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data60 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a right window join tba2 b window_offset(-1s, 1s) order by b.ts desc, a.ts;
|
|
if $rows != 7 then
|
|
return -1
|
|
endi
|
|
if $data00 != @23-11-17 16:29:04.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:02.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: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
|
|
if $data40 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data41 != @23-11-17 16:29:01.000@ then
|
|
return -1
|
|
endi
|
|
if $data50 != @23-11-17 16:29:02.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:00.000@ then
|
|
return -1
|
|
endi
|
|
if $data61 != @23-11-17 16:29:00.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a right 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: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: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:05.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a right 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 != NULL 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 != NULL then
|
|
return -1
|
|
endi
|
|
if $data31 != @23-11-17 16:29:05.000@ then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a right window join tba2 b window_offset(-1h, 1h);
|
|
if $rows != 16 then
|
|
return -1
|
|
endi
|
|
sql select a.ts, b.ts from tba1 a right window join tba2 b window_offset(1h, -1h);
|
|
if $rows != 16 then
|
|
return -1
|
|
endi
|
|
|
|
sql select a.ts, b.ts from tba1 a right window join tba2 b window_offset(1a, -1h);
|
|
if $rows != 9 then
|
|
return -1
|
|
endi
|