提交 e94cbdf5 编写于 作者: P Ping Xiao

[TD-1002]<test>: add test case for double type

上级 31f9b71d
......@@ -28,13 +28,13 @@ class TDTestCase:
def run(self):
tdSql.prepare()
tdSql.execute("create table test(ts timestamp, col1 int, col2 float)")
tdSql.execute("create table test(ts timestamp, col1 int, col2 float, col3 double)")
for i in range(1000):
sql = "insert into test values"
batchSize = int (self.rowNum / 1000)
for j in range (batchSize):
currTime = self.ts + batchSize * i + j
sql += "(%d, 1, 2.37)" % currTime
sql += "(%d, 1, 2.37, 3.1415926)" % currTime
tdSql.execute(sql)
tdSql.query("select percentile(col1, 20) from test")
......@@ -43,12 +43,18 @@ class TDTestCase:
tdSql.query("select percentile(col2, 20) from test")
tdSql.checkData(0, 0, 2.3699998)
tdSql.query("select percentile(col3, 20) from test")
tdSql.checkData(0, 0, 3.1415926)
tdSql.query("select apercentile(col1, 20) from test")
tdSql.checkData(0, 0, 1)
tdSql.query("select apercentile(col2, 20) from test")
tdSql.checkData(0, 0, 2.3699998)
tdSql.query("select apercentile(col3, 20) from test")
tdSql.checkData(0, 0, 3.1415926)
def stop(self):
tdSql.close()
tdLog.success("%s successfully executed" % __file__)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册