enh: add right asof join test cases
This commit is contained in:
parent
dc309d67b8
commit
4a516556a9
|
@ -66,7 +66,7 @@ enum {
|
|||
};
|
||||
|
||||
#define COL_DISPLAY_WIDTH 18
|
||||
#define JT_MAX_LOOP 5000
|
||||
#define JT_MAX_LOOP 50000
|
||||
|
||||
#define LEFT_BLK_ID 0
|
||||
#define RIGHT_BLK_ID 1
|
||||
|
|
|
@ -66,6 +66,7 @@ run tsim/join/right_semi_join.sim
|
|||
run tsim/join/left_anti_join.sim
|
||||
run tsim/join/right_anti_join.sim
|
||||
run tsim/join/left_asof_join.sim
|
||||
run tsim/join/right_asof_join.sim
|
||||
|
||||
print ================== restart server to commit data into disk
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
@ -81,5 +82,6 @@ run tsim/join/right_semi_join.sim
|
|||
run tsim/join/left_anti_join.sim
|
||||
run tsim/join/right_anti_join.sim
|
||||
run tsim/join/left_asof_join.sim
|
||||
run tsim/join/right_asof_join.sim
|
||||
|
||||
system sh/exec.sh -n dnode1 -s stop -x SIGINT
|
||||
|
|
|
@ -17,15 +17,9 @@ endi
|
|||
if $data00 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 1 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select a.ts, b.ts from tba1 a left asof join tba2 b on a.ts = b.ts;
|
||||
if $rows != 4 then
|
||||
|
|
|
@ -0,0 +1,476 @@
|
|||
sql connect
|
||||
sql use test0;
|
||||
|
||||
sql_error select a.col1, b.col1 from sta a right asof 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' order by a.col1, b.col1;
|
||||
sql select a.col1, b.col1 from sta a right asof join sta b on a.ts = b.ts order by a.col1, b.col1;
|
||||
if $rows != 8 then
|
||||
return -1
|
||||
endi
|
||||
sql select a.col1, b.col1 from sta a right asof join sta b on a.ts >= b.ts order by a.col1, b.col1;
|
||||
if $rows != 8 then
|
||||
return -1
|
||||
endi
|
||||
sql select a.col1, b.col1 from sta a right asof join sta b on a.ts = b.ts where a.ts < '2023-11-17 16:29:02' and b.ts < '2023-11-17 16:29:01' order by b.col1;
|
||||
if $rows != 2 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != 2 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select a.ts, b.ts from tba1 a right asof join tba2 b on a.ts = b.ts;
|
||||
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 asof join tba2 b on b.ts = a.ts;
|
||||
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 asof join tba2 b on a.ts >= b.ts ;
|
||||
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 != 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 asof join tba2 b on b.ts <= a.ts ;
|
||||
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 != 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 asof join tba2 b on a.ts > b.ts ;
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @23-11-17 16:29:02.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:04.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 asof join tba2 b on b.ts < a.ts ;
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @23-11-17 16:29:02.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:04.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 asof join tba2 b on a.ts <= b.ts ;
|
||||
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: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:05.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select a.ts, b.ts from tba1 a right asof join tba2 b on b.ts >= a.ts ;
|
||||
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: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:05.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
sql select a.ts, b.ts from tba1 a right asof join tba2 b on a.ts < b.ts ;
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != NULL 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 asof join tba2 b on b.ts > a.ts ;
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != NULL 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 tba2 a right asof join tba1 b on a.ts >= b.ts;
|
||||
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:03.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:05.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 tba2 a right asof join tba1 b on a.ts > b.ts;
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @23-11-17 16:29:01.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:03.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:05.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:05.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 tba2 a right asof join tba1 b on a.ts <= b.ts;
|
||||
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:01.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: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 tba2 a right asof join tba1 b on a.ts < b.ts;
|
||||
if $rows != 4 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != @23-11-17 16:29:00.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data10 != @23-11-17 16:29:01.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:01.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 tba1 a right asof join tba2 b on a.ts > b.ts jlimit 2
|
||||
if $rows != 6 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != @23-11-17 16:29:02.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:03.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data11 != @23-11-17 16:29:00.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:03.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data31 != @23-11-17 16:29:01.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data40 != @23-11-17 16:29:04.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data41 != @23-11-17 16:29:03.000@ then
|
||||
return -1
|
||||
endi
|
||||
if $data50 != NULL then
|
||||
return -1
|
||||
endi
|
||||
if $data51 != @23-11-17 16:29:05.000@ then
|
||||
return -1
|
||||
endi
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue