未验证 提交 5570e964 编写于 作者: G Ganlin Zhao 提交者: GitHub

Merge pull request #15972 from taosdata/fix/TD-18115

test: add interp test cases
此差异已折叠。
......@@ -335,7 +335,7 @@ class TDTestCase:
# case11 = {"alias": ", st1"}
# self.checksample(**case11)
tdSql.query("select sample( c1 , 1 ) , st1 from t1")
# case12 = {"alias": ", c1"}
# self.checksample(**case12)
......@@ -497,7 +497,7 @@ class TDTestCase:
# 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)
tdSql.query("select sample( c1 , 1 ) , c1 from t1")
......@@ -605,14 +605,14 @@ class TDTestCase:
tdSql.execute(f"create table tt{i} using stb2 tags({i})")
pass
def check_sample(self , sample_query , origin_query ):
tdSql.query(origin_query)
origin_datas = tdSql.queryResult
tdSql.query(sample_query)
sample_datas = tdSql.queryResult
......@@ -620,7 +620,7 @@ class TDTestCase:
for ind , sample_data in enumerate(sample_datas):
if sample_data not in origin_datas:
status = False
if status:
tdLog.info(" sample data is in datas groups ,successed sql is : %s" % sample_query )
else:
......@@ -637,7 +637,7 @@ class TDTestCase:
tags (t1 int)
'''
)
tdSql.execute(
'''
create table t1
......@@ -689,7 +689,7 @@ class TDTestCase:
tdSql.error(" select sample(c1,ts) from t1 ")
tdSql.error(" select sample(c1,false) from t1 ")
tdSql.query(" select sample(123,1) from t1 ")
tdSql.query(" select sample(c1,2) from t1 ")
tdSql.checkRows(2)
tdSql.query(" select sample(c1,10) from t1 ")
......@@ -704,10 +704,10 @@ class TDTestCase:
tdSql.checkRows(9)
tdSql.error(" select sample(c1,-1) from t1 ")
# bug need fix
# bug need fix
# tdSql.query("select sample(c1 ,2) , 123 from stb1;")
# all type support
# all type support
tdSql.query(" select sample(c1 , 20 ) from ct4 ")
tdSql.checkRows(9)
......@@ -761,7 +761,7 @@ class TDTestCase:
self.check_sample("select sample( c1 ,3 ) from t1 where c1 between 1 and 10" ,"select c1 from t1 where c1 between 1 and 10")
# join
# join
tdSql.query("select sample( ct4.c1 , 1 ) from ct1, ct4 where ct4.ts=ct1.ts")
......@@ -772,22 +772,22 @@ class TDTestCase:
self.check_sample("select sample(c1,2) from stb1 partition by tbname" , "select c1 from stb1 partition by tbname")
# nest query
# nest query
# tdSql.query("select sample(c1,2) from (select c1 from t1); ")
# tdSql.checkRows(2)
# union all
# union all
tdSql.query("select sample(c1,2) from t1 union all select sample(c1,3) from t1")
tdSql.checkRows(5)
# fill interval
# not support mix with other function
# 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.query("select c1 , sample(c1,2) from ct1")
# bug for mix with scalar
# bug for mix with scalar
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")
......@@ -864,13 +864,13 @@ class TDTestCase:
for i in range(2000):
ts = self.ts+i*10
tdSql.execute(f"insert into sub_tb values({ts} ,{i})")
tdSql.query("select count(*) from st")
tdSql.checkData(0,0,2000)
tdSql.query("select sample(c1 ,1000) from st")
tdSql.checkRows(1000)
# bug need fix
# bug need fix
tdSql.query("select c1 ,t1, sample(c1,2) from db.stb1 partition by c1 ")
tdSql.query("select sample(c1,2) from db.stb1 partition by c1 ")
# tdSql.query("select c1 ,ind, sample(c1,2) from sample_db.st partition by c1 ")
......
......@@ -96,6 +96,8 @@ python3 ./test.py -f 2-query/distribute_agg_stddev.py
python3 ./test.py -f 2-query/distribute_agg_stddev.py -R
python3 ./test.py -f 2-query/distribute_agg_sum.py
python3 ./test.py -f 2-query/distribute_agg_sum.py -R
python3 ./test.py -f 2-query/interp.py
python3 ./test.py -f 2-query/interp.py -R
......@@ -338,6 +340,7 @@ python3 ./test.py -f 2-query/arcsin.py -Q 2
python3 ./test.py -f 2-query/arccos.py -Q 2
python3 ./test.py -f 2-query/arctan.py -Q 2
python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 2
python3 ./test.py -f 2-query/interp.py -Q 2
# python3 ./test.py -f 2-query/nestedQuery.py -Q 2
# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 2
......@@ -457,3 +460,4 @@ python3 ./test.py -f 2-query/max_partition.py -Q 3
python3 ./test.py -f 2-query/last_row.py -Q 3
python3 ./test.py -f 2-query/tsbsQuery.py -Q 3
python3 ./test.py -f 2-query/sml.py -Q 3
python3 ./test.py -f 2-query/interp.py -Q 3
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册