Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2cb14466
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
2cb14466
编写于
7月 26, 2022
作者:
C
cpwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix case
上级
5b06d8df
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
16 addition
and
26 deletion
+16
-26
tests/pytest/util/common.py
tests/pytest/util/common.py
+12
-17
tests/system-test/1-insert/mutil_stage.py
tests/system-test/1-insert/mutil_stage.py
+4
-9
未找到文件。
tests/pytest/util/common.py
浏览文件 @
2cb14466
...
...
@@ -80,23 +80,18 @@ class DataSet:
self
.
bool_data
.
append
(
bool
((
i
+
bool_start
)
%
2
))
self
.
vchar_data
.
append
(
f
"
{
vchar_prefix
}
_
{
i
*
vchar_step
}
"
)
self
.
nchar_data
.
append
(
f
"
{
nchar_prefix
}
_
{
i
*
nchar_step
}
"
)
self
.
ts_data
.
append
(
int
(
datetime
.
datetime
.
timestamp
(
datetime
.
datetime
.
now
())
*
1000
-
i
*
ts_step
))
def
get_disorder_set
(
self
,
rows
,
int_low
:
int
=
INT_MIN
,
int_up
:
int
=
INT_MAX
,
bint_low
:
int
=
BIGINT_MIN
,
bint_up
:
int
=
BIGINT_MAX
,
sint_low
:
int
=
SMALLINT_MIN
,
sint_up
:
int
=
SMALLINT_MAX
,
tint_low
:
int
=
TINYINT_MIN
,
tint_up
:
int
=
TINYINT_MAX
,
ubint_low
:
int
=
BIGINT_UN_MIN
,
ubint_up
:
int
=
BIGINT_UN_MAX
,
):
self
.
ts_data
.
append
(
int
(
datetime
.
timestamp
(
datetime
.
now
())
*
1000
-
i
*
ts_step
))
def
get_disorder_set
(
self
,
rows
,
**
kwargs
):
for
k
,
v
in
kwargs
.
items
():
int_low
=
v
if
k
==
"int_low"
else
INT_MIN
int_up
=
v
if
k
==
"int_up"
else
INT_MAX
bint_low
=
v
if
k
==
"bint_low"
else
BIGINT_MIN
bint_up
=
v
if
k
==
"bint_up"
else
BIGINT_MAX
sint_low
=
v
if
k
==
"sint_low"
else
SMALLINT_MIN
sint_up
=
v
if
k
==
"sint_up"
else
SMALLINT_MAX
tint_low
=
v
if
k
==
"tint_low"
else
TINYINT_MIN
tint_up
=
v
if
k
==
"tint_up"
else
TINYINT_MAX
pass
...
...
tests/system-test/1-insert/mutil_stage.py
浏览文件 @
2cb14466
...
...
@@ -193,8 +193,9 @@ class TDTestCase:
{
INT_UN_COL
}
int unsigned,
{
BINT_UN_COL
}
bigint unsigned
) tags (
{
INT_TAG
}
int)
'''
for
i
in
range
(
ntbnum
):
tdSql
.
execute
(
create_stb_sql
)
for
i
in
range
(
ntbnum
):
create_ntb_sql
=
f
'''create table
{
dbname
}
.
{
ntb_pre
}{
i
+
1
}
(
ts timestamp,
{
INT_COL
}
int,
{
BINT_COL
}
bigint,
{
SINT_COL
}
smallint,
{
TINT_COL
}
tinyint,
{
FLOAT_COL
}
float,
{
DOUBLE_COL
}
double,
{
BOOL_COL
}
bool,
...
...
@@ -203,8 +204,7 @@ class TDTestCase:
{
INT_UN_COL
}
int unsigned,
{
BINT_UN_COL
}
bigint unsigned
)
'''
tdSql
.
execute
(
create_stb_sql
)
tdSql
.
execute
(
create_ntb_sql
)
tdSql
.
execute
(
create_ntb_sql
)
for
i
in
range
(
ctb_num
):
tdSql
.
execute
(
f
'create table
{
dbname
}
.
{
ctb_pre
}{
i
+
1
}
using
{
dbname
}
.
{
stb
}
tags (
{
i
+
1
}
)'
)
...
...
@@ -213,9 +213,6 @@ class TDTestCase:
data
=
DataSet
().
get_order_set
(
rows
)
tdLog
.
printNoPrefix
(
"==========step: start inser data into tables now....."
)
# now_time = int(datetime.datetime.timestamp(datetime.datetime.now()) * 1000)
for
i
in
range
(
self
.
rows
):
row_data
=
f
'''
{
data
.
int_data
[
i
]
}
,
{
data
.
bint_data
[
i
]
}
,
{
data
.
sint_data
[
i
]
}
,
{
data
.
tint_data
[
i
]
}
,
{
data
.
float_data
[
i
]
}
,
{
data
.
double_data
[
i
]
}
,
...
...
@@ -237,12 +234,10 @@ class TDTestCase:
tdSql
.
execute
(
f
"insert into
{
dbname
}
.
{
NTB_PRE
}
1 values (
{
NOW
-
i
*
int
(
TIME_STEP
*
1.2
)
}
,
{
row_data
}
)"
)
def
run
(
self
):
self
.
rows
=
10
self
.
cfg_check
()
tdSql
.
prepare
(
dbname
=
DBNAME
,
**
{
"keep"
:
"
5m, 10m, 15m"
,
"duration"
:
"5m
"
})
tdSql
.
prepare
(
dbname
=
DBNAME
,
**
{
"keep"
:
"
1d, 1500m, 26h"
,
"duration"
:
"1h
"
})
self
.
__create_tb
(
dbname
=
DBNAME
)
self
.
__insert_data
(
rows
=
self
.
rows
,
dbname
=
DBNAME
)
tdSql
.
query
(
f
"select count(*) from
{
DBNAME
}
.
{
NTB_PRE
}
1"
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录