From 106bbc7e63cc047ca81e0699c7bb482312f45615 Mon Sep 17 00:00:00 2001 From: tomchon Date: Tue, 22 Jun 2021 18:42:31 +0800 Subject: [PATCH] [TD-4314]: add testcase of nested query with top/bottom function --- tests/pytest/fulltest.sh | 2 ++ tests/pytest/query/nestedQuery/queryInterval.py | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/tests/pytest/fulltest.sh b/tests/pytest/fulltest.sh index c9f68972f9..9373553cba 100755 --- a/tests/pytest/fulltest.sh +++ b/tests/pytest/fulltest.sh @@ -235,6 +235,8 @@ python3 ./test.py -f query/queryTscomputWithNow.py python3 ./test.py -f query/computeErrorinWhere.py python3 ./test.py -f query/queryTsisNull.py python3 ./test.py -f query/subqueryFilter.py +python3 ./test.py -f query/nestedQuery/queryInterval.py +python3 ./test.py -f query/queryStateWindow.py #stream diff --git a/tests/pytest/query/nestedQuery/queryInterval.py b/tests/pytest/query/nestedQuery/queryInterval.py index 3ddf751b7f..11c42c463e 100644 --- a/tests/pytest/query/nestedQuery/queryInterval.py +++ b/tests/pytest/query/nestedQuery/queryInterval.py @@ -83,14 +83,16 @@ class TDTestCase: tdSql.checkData(29, 0, "2020-07-01 05:10:00.000") # subquery and parent query with top and bottom - tdSql.query("select top(avg_val,2) from(select avg(value) as avg_val,num from st where loc!='beijing0' group by num);") - tdSql.checkData(0, 1, 115) - tdSql.query("select bottom(avg_val,3) from(select avg(value) as avg_val,num from st where loc!='beijing0' group by num);") - tdSql.checkData(0, 1, 125) + tdSql.query("select top(avg_val,2) from(select avg(value) as avg_val,num from st where loc!='beijing0' group by num) order by avg_val desc;") + tdSql.checkData(0, 1, 117) + tdSql.query("select bottom(avg_val,3) from(select avg(value) as avg_val,num from st where loc!='beijing0' group by num) order by avg_val asc;") + tdSql.checkData(0, 1, 111) # tdSql.query("select top(avg_val,2) from(select avg(value) as avg_val from st where loc='beijing1' interval(8m) sliding(3m));") + tdSql.checkData(0, 1, 120) + # clear env testcaseFilename = os.path.split(__file__)[-1] os.system("rm -rf ./insert_res.txt") os.system("rm -rf wal/%s.sql" % testcaseFilename ) -- GitLab