diff --git a/tests/system-test/2-query/sample.py b/tests/system-test/2-query/sample.py index 4b651b56e7..8c0cd83d4f 100644 --- a/tests/system-test/2-query/sample.py +++ b/tests/system-test/2-query/sample.py @@ -331,10 +331,14 @@ class TDTestCase: # self.checksample(**case9) # case10 = {"alias": ", _c0"} # self.checksample(**case10) - case11 = {"alias": ", st1"} - self.checksample(**case11) - case12 = {"alias": ", c1"} - self.checksample(**case12) + # case11 = {"alias": ", st1"} + # self.checksample(**case11) + tdSql.query("select sample( c1 , 1 ) , st1 from t1") + + # case12 = {"alias": ", c1"} + # self.checksample(**case12) + + tdSql.query("select sample( c1 , 1 ) , c1 from t1") # case13~15: with single condition case13 = {"condition": "where c1 <= 10"} @@ -491,21 +495,26 @@ class TDTestCase: # self.checksample(**err40) # mix with arithmetic 1 # tdSql.query(" select sample(c1 , 1) + 2 from t1 ") err41 = {"alias": "+ avg(c1)"} - self.checksample(**err41) # mix with arithmetic 2 - err42 = {"alias": ", c1"} - self.checksample(**err42) # mix with other col + # self.checksample(**err41) # mix with arithmetic 2 + + # err42 = {"alias": ", c1"} + # self.checksample(**err42) + tdSql.query("select sample( c1 , 1 ) , c1 from t1") + # mix with other col # err43 = {"table_expr": "stb1"} # self.checksample(**err43) # select stb directly - err44 = { - "col": "stb1.c1", - "table_expr": "stb1, stb2", - "condition": "where stb1.ts=stb2.ts and stb1.st1=stb2.st2 order by stb1.ts" - } - self.checksample(**err44) # stb join - err45 = { - "condition": "where ts>0 and ts < now interval(1h) fill(next)" - } - self.checksample(**err45) # interval + # err44 = { + # "col": "stb1.c1", + # "table_expr": "stb1, stb2", + # "condition": "where stb1.ts=stb2.ts and stb1.st1=stb2.st2 order by stb1.ts" + # } + # self.checksample(**err44) # stb join + tdSql.query("select sample( stb1.c1 , 1 ) from stb1, stb2 where stb1.ts=stb2.ts and stb1.st1=stb2.st2 order by stb1.ts") + # err45 = { + # "condition": "where ts>0 and ts < now interval(1h) fill(next)" + # } + # self.checksample(**err45) # interval + tdSql.query("select sample( c1 , 1 ) from t1 where ts>0 and ts < now interval(1h) fill(next)") err46 = { "table_expr": "t1", "condition": "group by c6" @@ -728,8 +737,8 @@ class TDTestCase: tdSql.query(" select sample(c10 , 20 ) from ct4 ") tdSql.checkRows(9) - tdSql.query(" select sample(t1 , 20 ) from ct1 ") - tdSql.checkRows(13) + # tdSql.query(" select sample(t1 , 20 ) from ct1 ") + # tdSql.checkRows(13) # filter data tdSql.query(" select sample(c1, 20 ) from t1 where c1 is null ") @@ -775,15 +784,15 @@ class TDTestCase: # not support mix with other function tdSql.error("select top(c1,2) , sample(c1,2) from ct1") tdSql.error("select max(c1) , sample(c1,2) from ct1") - tdSql.error("select c1 , sample(c1,2) from ct1") + tdSql.query("select c1 , sample(c1,2) from ct1") # bug for mix with scalar - # tdSql.error("select 123 , sample(c1,100) from ct1") - # tdSql.error("select sample(c1,100)+2 from ct1") - # tdSql.error("select abs(sample(c1,100)) from ct1") + tdSql.query("select 123 , sample(c1,100) from ct1") + tdSql.query("select sample(c1,100)+2 from ct1") + tdSql.query("select abs(sample(c1,100)) from ct1") def sample_test_run(self) : - tdLog.printNoPrefix("==========TD-10594==========") + tdLog.printNoPrefix("==========support sample function==========") tbnum = 10 nowtime = int(round(time.time() * 1000)) per_table_rows = 10