Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
慢慢CG
TDengine
提交
f63f60b5
T
TDengine
项目概览
慢慢CG
/
TDengine
与 Fork 源项目一致
Fork自
taosdata / TDengine
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
f63f60b5
编写于
2月 20, 2021
作者:
L
liuyq-617
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
modify
上级
8378850b
变更
24
隐藏空白更改
内联
并排
Showing
24 changed file
with
172 addition
and
74 deletion
+172
-74
tests/pytest/functions/function_avg.py
tests/pytest/functions/function_avg.py
+12
-4
tests/pytest/functions/function_avg_restart.py
tests/pytest/functions/function_avg_restart.py
+12
-4
tests/pytest/functions/function_bottom.py
tests/pytest/functions/function_bottom.py
+23
-3
tests/pytest/functions/function_bottom_restart.py
tests/pytest/functions/function_bottom_restart.py
+23
-3
tests/pytest/functions/function_count.py
tests/pytest/functions/function_count.py
+13
-4
tests/pytest/functions/function_count_restart.py
tests/pytest/functions/function_count_restart.py
+12
-3
tests/pytest/functions/function_diff.py
tests/pytest/functions/function_diff.py
+28
-4
tests/pytest/functions/function_diff_restart.py
tests/pytest/functions/function_diff_restart.py
+3
-3
tests/pytest/functions/function_first.py
tests/pytest/functions/function_first.py
+3
-3
tests/pytest/functions/function_last.py
tests/pytest/functions/function_last.py
+3
-3
tests/pytest/functions/function_last_row.py
tests/pytest/functions/function_last_row.py
+3
-3
tests/pytest/functions/function_leastsquares.py
tests/pytest/functions/function_leastsquares.py
+3
-3
tests/pytest/functions/function_max.py
tests/pytest/functions/function_max.py
+3
-3
tests/pytest/functions/function_max_restart.py
tests/pytest/functions/function_max_restart.py
+1
-1
tests/pytest/functions/function_min.py
tests/pytest/functions/function_min.py
+3
-3
tests/pytest/functions/function_operations.py
tests/pytest/functions/function_operations.py
+3
-3
tests/pytest/functions/function_percentile.py
tests/pytest/functions/function_percentile.py
+3
-3
tests/pytest/functions/function_spread.py
tests/pytest/functions/function_spread.py
+3
-3
tests/pytest/functions/function_stddev.py
tests/pytest/functions/function_stddev.py
+3
-3
tests/pytest/functions/function_stddev_td2555.py
tests/pytest/functions/function_stddev_td2555.py
+3
-3
tests/pytest/functions/function_sum.py
tests/pytest/functions/function_sum.py
+3
-3
tests/pytest/functions/function_top.py
tests/pytest/functions/function_top.py
+3
-3
tests/pytest/functions/function_twa.py
tests/pytest/functions/function_twa.py
+3
-3
tests/pytest/functions/function_twa_restart.py
tests/pytest/functions/function_twa_restart.py
+3
-3
未找到文件。
tests/pytest/functions/function_avg.py
浏览文件 @
f63f60b5
...
...
@@ -34,11 +34,11 @@ class TDTestCase:
floatData
=
[]
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
@@ -63,7 +63,15 @@ class TDTestCase:
tdSql
.
query
(
"select avg(col5) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
floatData
))
tdSql
.
query
(
"select avg(col6) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
floatData
))
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
floatData
))
tdSql
.
query
(
"select avg(col11) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
intData
))
tdSql
.
query
(
"select avg(col12) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
intData
))
tdSql
.
query
(
"select avg(col13) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
intData
))
tdSql
.
query
(
"select avg(col14) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
intData
))
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/pytest/functions/function_avg_restart.py
浏览文件 @
f63f60b5
...
...
@@ -34,11 +34,11 @@ class TDTestCase:
floatData
=
[]
#tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
# col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''')
# col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))''')
#tdSql.execute("create table test1 using test tags('beijing')")
for
i
in
range
(
self
.
rowNum
):
#tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1))
#tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1
, i + 1, i + 1, i + 1, i + 1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
@@ -63,7 +63,15 @@ class TDTestCase:
tdSql
.
query
(
"select avg(col5) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
floatData
))
tdSql
.
query
(
"select avg(col6) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
floatData
))
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
floatData
))
tdSql
.
query
(
"select avg(col11) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
intData
))
tdSql
.
query
(
"select avg(col12) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
intData
))
tdSql
.
query
(
"select avg(col13) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
intData
))
tdSql
.
query
(
"select avg(col14) from test"
)
tdSql
.
checkData
(
0
,
0
,
np
.
average
(
intData
))
def
stop
(
self
):
tdSql
.
close
()
...
...
tests/pytest/functions/function_bottom.py
浏览文件 @
f63f60b5
...
...
@@ -31,11 +31,11 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
# bottom verifacation
tdSql
.
error
(
"select bottom(ts, 10) from test"
)
...
...
@@ -84,6 +84,26 @@ class TDTestCase:
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
0.1
)
tdSql
.
checkData
(
1
,
1
,
1.1
)
tdSql
.
query
(
"select bottom(col11, 2) from test"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
1
,
2
)
tdSql
.
query
(
"select bottom(col12, 2) from test"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
1
,
2
)
tdSql
.
query
(
"select bottom(col13, 2) from test"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
1
,
2
)
tdSql
.
query
(
"select bottom(col14, 2) from test"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
1
,
2
)
#TD-2457 bottom + interval + order by
tdSql
.
error
(
'select top(col2,1) from test interval(1y) order by col2;'
)
...
...
tests/pytest/functions/function_bottom_restart.py
浏览文件 @
f63f60b5
...
...
@@ -31,11 +31,11 @@ class TDTestCase:
tdSql
.
execute
(
"use db"
)
#tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
# col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''')
# col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))''')
#tdSql.execute("create table test1 using test tags('beijing')")
#for i in range(self.rowNum):
# tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1))
# tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1
, i + 1, i + 1, i + 1, i + 1
))
# bottom verifacation
tdSql
.
error
(
"select bottom(ts, 10) from test"
)
...
...
@@ -75,6 +75,26 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
1
,
2
)
tdSql
.
query
(
"select bottom(col11, 2) from test"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
1
,
2
)
tdSql
.
query
(
"select bottom(col12, 2) from test"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
1
,
2
)
tdSql
.
query
(
"select bottom(col13, 2) from test"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
1
,
2
)
tdSql
.
query
(
"select bottom(col14, 2) from test"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
1
)
tdSql
.
checkData
(
1
,
1
,
2
)
tdSql
.
query
(
"select bottom(col5, 2) from test"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkData
(
0
,
1
,
0.1
)
...
...
tests/pytest/functions/function_count.py
浏览文件 @
f63f60b5
...
...
@@ -31,11 +31,11 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
# Count verifacation
tdSql
.
query
(
"select count(*) from test"
)
...
...
@@ -62,11 +62,20 @@ class TDTestCase:
tdSql
.
query
(
"select count(col9) from test"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
query
(
"select count(col11) from test"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
query
(
"select count(col12) from test"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
query
(
"select count(col13) from test"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
query
(
"select count(col14) from test"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
execute
(
"alter table test add column col10 int"
)
tdSql
.
query
(
"select count(col10) from test"
)
tdSql
.
checkRows
(
0
)
tdSql
.
execute
(
"insert into test1 values(now, 1, 2, 3, 4, 1.1, 2.2, false, 'test', 'test' 1)"
)
tdSql
.
execute
(
"insert into test1 values(now, 1, 2, 3, 4, 1.1, 2.2, false, 'test', 'test'
, 1, 1, 1, 1,
1)"
)
tdSql
.
query
(
"select count(col10) from test"
)
tdSql
.
checkData
(
0
,
0
,
1
)
...
...
tests/pytest/functions/function_count_restart.py
浏览文件 @
f63f60b5
...
...
@@ -31,11 +31,11 @@ class TDTestCase:
tdSql
.
execute
(
"use db"
)
#tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
# col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''')
# col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))''')
#tdSql.execute("create table test1 using test tags('beijing')")
#for i in range(self.rowNum):
# tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1))
# tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1
, i + 1, i + 1, i + 1, i + 1
))
# Count verifacation
tdSql
.
query
(
"select count(*) from test"
)
...
...
@@ -62,6 +62,15 @@ class TDTestCase:
tdSql
.
query
(
"select count(col9) from test"
)
tdSql
.
checkData
(
0
,
0
,
11
)
tdSql
.
query
(
"select count(col11) from test"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
query
(
"select count(col12) from test"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
query
(
"select count(col13) from test"
)
tdSql
.
checkData
(
0
,
0
,
10
)
tdSql
.
query
(
"select count(col14) from test"
)
tdSql
.
checkData
(
0
,
0
,
10
)
#tdSql.execute("alter table test add column col10 int")
#tdSql.query("select count(col10) from test")
#tdSql.checkRows(0)
...
...
tests/pytest/functions/function_diff.py
浏览文件 @
f63f60b5
...
...
@@ -31,9 +31,9 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
tdSql
.
execute
(
"insert into test1 values(%d, 0, 0, 0, 0, 0.0, 0.0, False, ' ', ' ')"
%
(
self
.
ts
-
1
))
tdSql
.
execute
(
"insert into test1 values(%d, 0, 0, 0, 0, 0.0, 0.0, False, ' ', ' '
, 0, 0, 0, 0
)"
%
(
self
.
ts
-
1
))
# diff verifacation
tdSql
.
query
(
"select diff(col1) from test1"
)
...
...
@@ -54,9 +54,21 @@ class TDTestCase:
tdSql
.
query
(
"select diff(col6) from test1"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select diff(col11) from test1"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select diff(col12) from test1"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select diff(col13) from test1"
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select diff(col14) from test1"
)
tdSql
.
checkRows
(
0
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
tdSql
.
error
(
"select diff(ts) from test"
)
tdSql
.
error
(
"select diff(ts) from test1"
)
...
...
@@ -85,6 +97,18 @@ class TDTestCase:
tdSql
.
query
(
"select diff(col4) from test1"
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"select diff(col11) from test1"
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"select diff(col12) from test1"
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"select diff(col13) from test1"
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"select diff(col14) from test1"
)
tdSql
.
checkRows
(
10
)
tdSql
.
query
(
"select diff(col5) from test1"
)
tdSql
.
checkRows
(
10
)
...
...
tests/pytest/functions/function_diff_restart.py
浏览文件 @
f63f60b5
...
...
@@ -31,7 +31,7 @@ class TDTestCase:
tdSql
.
execute
(
"use db"
)
#tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
# col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''')
# col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))''')
#tdSql.execute("create table test1 using test tags('beijing')")
#tdSql.execute("insert into test1 values(%d, 0, 0, 0, 0, 0.0, 0.0, False, ' ', ' ')" % (self.ts - 1))
...
...
@@ -55,8 +55,8 @@ class TDTestCase:
#tdSql.checkRows(0)
#for i in range(self.rowNum):
# tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1))
# tdSql.execute("insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
# % (self.ts + i, i + 1, i + 1, i + 1, i + 1, i + 0.1, i + 0.1, i % 2, i + 1, i + 1
, i + 1, i + 1, i + 1, i + 1
))
tdSql
.
error
(
"select diff(ts) from test"
)
tdSql
.
error
(
"select diff(ts) from test1"
)
...
...
tests/pytest/functions/function_first.py
浏览文件 @
f63f60b5
...
...
@@ -31,7 +31,7 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
tdSql
.
execute
(
"insert into test1(ts) values(%d)"
%
(
self
.
ts
-
1
))
...
...
@@ -68,8 +68,8 @@ class TDTestCase:
tdSql
.
checkRows
(
0
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
tdSql
.
query
(
"select first(*) from test1"
)
tdSql
.
checkRows
(
1
)
...
...
tests/pytest/functions/function_last.py
浏览文件 @
f63f60b5
...
...
@@ -31,7 +31,7 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
tdSql
.
execute
(
"insert into test1(ts) values(%d)"
%
(
self
.
ts
-
1
))
...
...
@@ -68,8 +68,8 @@ class TDTestCase:
tdSql
.
checkRows
(
0
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
tdSql
.
query
(
"select last(*) from test1"
)
tdSql
.
checkRows
(
1
)
...
...
tests/pytest/functions/function_last_row.py
浏览文件 @
f63f60b5
...
...
@@ -31,7 +31,7 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
tdSql
.
execute
(
"insert into test1(ts) values(%d)"
%
(
self
.
ts
-
1
))
...
...
@@ -77,8 +77,8 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
None
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
tdSql
.
query
(
"select last_row(*) from test1"
)
tdSql
.
checkRows
(
1
)
...
...
tests/pytest/functions/function_leastsquares.py
浏览文件 @
f63f60b5
...
...
@@ -31,11 +31,11 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
# leastsquares verifacation
tdSql
.
error
(
"select leastsquares(ts, 1, 1) from test1"
)
...
...
tests/pytest/functions/function_max.py
浏览文件 @
f63f60b5
...
...
@@ -34,11 +34,11 @@ class TDTestCase:
floatData
=
[]
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
tests/pytest/functions/function_max_restart.py
浏览文件 @
f63f60b5
...
...
@@ -34,7 +34,7 @@ class TDTestCase:
floatData
=
[]
#tdSql.execute('''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
# col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))''')
# col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))''')
#tdSql.execute("create table test1 using test tags('beijing')")
for
i
in
range
(
self
.
rowNum
):
intData
.
append
(
i
+
1
)
...
...
tests/pytest/functions/function_min.py
浏览文件 @
f63f60b5
...
...
@@ -34,11 +34,11 @@ class TDTestCase:
floatData
=
[]
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
tests/pytest/functions/function_operations.py
浏览文件 @
f63f60b5
...
...
@@ -31,11 +31,11 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
# min verifacation
tdSql
.
error
(
"select ts + col1 from test"
)
...
...
tests/pytest/functions/function_percentile.py
浏览文件 @
f63f60b5
...
...
@@ -34,10 +34,10 @@ class TDTestCase:
floatData
=
[]
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
)'''
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
tests/pytest/functions/function_spread.py
浏览文件 @
f63f60b5
...
...
@@ -31,7 +31,7 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
tdSql
.
execute
(
"insert into test1 values(%d, 0, 0, 0, 0, 0.0, 0.0, False, ' ', ' ')"
%
(
self
.
ts
-
1
))
...
...
@@ -64,8 +64,8 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
0
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
tdSql
.
error
(
"select spread(col7) from test"
)
tdSql
.
error
(
"select spread(col7) from test1"
)
...
...
tests/pytest/functions/function_stddev.py
浏览文件 @
f63f60b5
...
...
@@ -34,11 +34,11 @@ class TDTestCase:
floatData
=
[]
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
tests/pytest/functions/function_stddev_td2555.py
浏览文件 @
f63f60b5
...
...
@@ -42,15 +42,15 @@ class TDTestCase:
tdSql
.
prepare
()
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(cid int,gbid binary(20),loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(cid int,gbid binary(20),loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags(1,'beijing','北京')"
)
tdSql
.
execute
(
"create table test2 using test tags(2,'shanghai','深圳')"
)
tdSql
.
execute
(
"create table test3 using test tags(2,'shenzhen','深圳')"
)
tdSql
.
execute
(
"create table test4 using test tags(1,'shanghai','上海')"
)
for
j
in
range
(
4
):
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test%d values(now-%dh, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
j
+
1
,
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
i
*
0.1
,
i
*
1.5
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test%d values(now-%dh, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
j
+
1
,
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
i
*
0.1
,
i
*
1.5
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
# stddev verifacation
tdSql
.
error
(
"select stddev(ts) from test"
)
...
...
tests/pytest/functions/function_sum.py
浏览文件 @
f63f60b5
...
...
@@ -34,11 +34,11 @@ class TDTestCase:
floatData
=
[]
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
tests/pytest/functions/function_top.py
浏览文件 @
f63f60b5
...
...
@@ -34,11 +34,11 @@ class TDTestCase:
floatData
=
[]
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
tests/pytest/functions/function_twa.py
浏览文件 @
f63f60b5
...
...
@@ -34,11 +34,11 @@ class TDTestCase:
floatData
=
[]
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
tests/pytest/functions/function_twa_restart.py
浏览文件 @
f63f60b5
...
...
@@ -34,11 +34,11 @@ class TDTestCase:
floatData
=
[]
tdSql
.
execute
(
'''create table test(ts timestamp, col1 tinyint, col2 smallint, col3 int, col4 bigint, col5 float, col6 double,
col7 bool, col8 binary(20), col9 nchar(20)) tags(loc nchar(20))'''
)
col7 bool, col8 binary(20), col9 nchar(20)
, col11 tinyint unsigned, col12 smallint unsigned, col13 int unsigned, col14 bigint unsigned
) tags(loc nchar(20))'''
)
tdSql
.
execute
(
"create table test1 using test tags('beijing')"
)
for
i
in
range
(
self
.
rowNum
):
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d')"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
))
tdSql
.
execute
(
"insert into test1 values(%d, %d, %d, %d, %d, %f, %f, %d, 'taosdata%d', '涛思数据%d'
, %d, %d, %d, %d
)"
%
(
self
.
ts
+
i
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
0.1
,
i
+
0.1
,
i
%
2
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
,
i
+
1
))
intData
.
append
(
i
+
1
)
floatData
.
append
(
i
+
0.1
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录