提交 535d0954 编写于 作者: L liuyq-617

[TD-2162]<test> add test for percentile

上级 50108363
...@@ -166,6 +166,7 @@ python3 ./test.py -f query/bug1875.py ...@@ -166,6 +166,7 @@ python3 ./test.py -f query/bug1875.py
python3 ./test.py -f query/bug1876.py python3 ./test.py -f query/bug1876.py
python3 ./test.py -f query/bug2218.py python3 ./test.py -f query/bug2218.py
python3 ./test.py -f query/bug2117.py python3 ./test.py -f query/bug2117.py
python3 ./test.py -f query/bug2118.py
python3 ./test.py -f query/bug2143.py python3 ./test.py -f query/bug2143.py
python3 ./test.py -f query/sliding.py python3 ./test.py -f query/sliding.py
python3 ./test.py -f query/unionAllTest.py python3 ./test.py -f query/unionAllTest.py
......
...@@ -23,8 +23,8 @@ class TDTestCase: ...@@ -23,8 +23,8 @@ class TDTestCase:
def run(self): def run(self):
tdSql.prepare() tdSql.prepare()
print("==========step1") tdLog.info("==========step1")
print("create table && insert data") tdLog.info("create table && insert data")
tdSql.execute("create table mt0 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool,c8 binary(20),c9 nchar(20))") tdSql.execute("create table mt0 (ts timestamp, c1 int, c2 float, c3 bigint, c4 smallint, c5 tinyint, c6 double, c7 bool,c8 binary(20),c9 nchar(20))")
insertRows = 1000 insertRows = 1000
...@@ -34,8 +34,8 @@ class TDTestCase: ...@@ -34,8 +34,8 @@ class TDTestCase:
ret = tdSql.execute( ret = tdSql.execute(
"insert into mt0 values (%d , %d,%d,%d,%d,%d,%d,%d,'%s','%s')" % "insert into mt0 values (%d , %d,%d,%d,%d,%d,%d,%d,'%s','%s')" %
(t0+i,i%100,i/2.0,i%41,i%51,i%53,i*1.0,i%2,'taos'+str(i%43),'涛思'+str(i%41))) (t0+i,i%100,i/2.0,i%41,i%51,i%53,i*1.0,i%2,'taos'+str(i%43),'涛思'+str(i%41)))
print("==========step2") tdLog.info("==========step2")
print("test percentile with group by normal_col ") tdLog.info("test percentile with group by normal_col ")
tdSql.query('select percentile(c1,1),percentile(c2,1),percentile(c6,1) from mt0 group by c3 limit 3 offset 2') tdSql.query('select percentile(c1,1),percentile(c2,1),percentile(c6,1) from mt0 group by c3 limit 3 offset 2')
tdSql.checkData(0,0,2.48) tdSql.checkData(0,0,2.48)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册