提交 dd22c929 编写于 作者: W wenzhouwww@live.cn

update sample function for new feature

上级 13907386
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册