Merge pull request #14248 from taosdata/test/abs_tag_filter

test: update case for tag compute
This commit is contained in:
Hui Li 2022-06-28 09:30:37 +08:00 committed by GitHub
commit ddf0ff111d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 10 deletions

View File

@ -23,7 +23,6 @@ class TDTestCase:
self.time_step = 1000 self.time_step = 1000
def insert_datas_and_check_abs(self ,tbnums , rownums , time_step ): def insert_datas_and_check_abs(self ,tbnums , rownums , time_step ):
tdLog.info(" prepare datas for auto check abs function ") tdLog.info(" prepare datas for auto check abs function ")
tdSql.execute(" create database test ") tdSql.execute(" create database test ")
@ -36,7 +35,7 @@ class TDTestCase:
ts = self.ts ts = self.ts
for row in range(rownums): for row in range(rownums):
ts += time_step*row ts = self.ts + time_step*row
c1 = random.randint(0,10000) c1 = random.randint(0,10000)
c2 = random.randint(0,100000) c2 = random.randint(0,100000)
c3 = random.randint(0,125) c3 = random.randint(0,125)
@ -538,22 +537,24 @@ class TDTestCase:
# tdSql.query(" select sum(c1) from stb1 where t1+10 >1; ") # taosd crash # tdSql.query(" select sum(c1) from stb1 where t1+10 >1; ") # taosd crash
tdSql.query("select c1 ,t1 from stb1 where t1 =0 ") tdSql.query("select c1 ,t1 from stb1 where t1 =0 ")
tdSql.checkRows(13) tdSql.checkRows(13)
# tdSql.query("select t1 from stb1 where t1 >0 ") tdSql.query("select t1 from stb1 where t1 >0 ")
# tdSql.checkRows(3) tdSql.checkRows(3)
tdSql.query("select t1 from stb1 where t1 =3 ")
tdSql.checkRows(1)
# tdSql.query("select sum(t1) from (select c1 ,t1 from stb1)") # tdSql.query("select sum(t1) from (select c1 ,t1 from stb1)")
# tdSql.checkData(0,0,61) # tdSql.checkData(0,0,61)
# tdSql.query("select distinct(c1) ,t1 from stb1") # tdSql.query("select distinct(c1) ,t1 from stb1")
# tdSql.checkRows(20) # tdSql.checkRows(20)
# tdSql.query("select max(t2) , t1 ,c1, t2 from stb1") tdSql.query("select max(t2) , t1 ,c1, t2 from stb1")
# tdSql.checkData(0,3,33333) tdSql.checkData(0,3,33333)
# tag filter with abs function # tag filter with abs function
# tdSql.query("select t1 from stb1 where abs(t1)=1") tdSql.query("select t1 from stb1 where abs(t1)=1")
# tdSql.checkRows(1) tdSql.checkRows(1)
tdSql.query("select t1 from stb1 where abs(c1+t1)=1") tdSql.query("select t1 from stb1 where abs(c1+t1)=1")
tdSql.checkRows(1) tdSql.checkRows(1)
# tdSql.query("select t1 from stb1 where abs(t1+c1)=1") tdSql.checkData(0,0,0)
# tdSql.checkRows(1)
tdSql.query( tdSql.query(
"select abs(c1+t1)*t1 from stb1 where abs(c1)/floor(abs(ceil(t1))) ==1") "select abs(c1+t1)*t1 from stb1 where abs(c1)/floor(abs(ceil(t1))) ==1")