feat: add test case to udf.sim
This commit is contained in:
parent
b766c05128
commit
b6fa8f704b
|
@ -94,6 +94,31 @@ endi
|
|||
if $data00 != 2.645751311 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql insert into t2 values(now+4s, 4, 8)(now+5s, 5, 9);
|
||||
sql select udf2(f1-f2), udf2(f1+f2) from t2;
|
||||
print $rows , $data00 , $data01
|
||||
if $rows != 1 then
|
||||
return -1;
|
||||
endi
|
||||
if $data00 != 5.656854249 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 18.547236991 then
|
||||
return -1
|
||||
endi
|
||||
|
||||
sql select udf2(udf1(f2-f1)), udf2(udf1(f2/f1)) from t2;
|
||||
if $rows != 1 then
|
||||
return -1
|
||||
endi
|
||||
if $data00 != 176.000000000 then
|
||||
return -1
|
||||
endi
|
||||
if $data01 != 152.420471066 then
|
||||
return -1
|
||||
endi
|
||||
print $rows , $data00 , $data01
|
||||
sql drop function udf1;
|
||||
sql show functions;
|
||||
if $rows != 1 then
|
||||
|
|
Loading…
Reference in New Issue