Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
50b61208
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
50b61208
编写于
6月 22, 2022
作者:
C
cpwu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix case
上级
57de6806
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
115 addition
and
77 deletion
+115
-77
tests/system-test/1-insert/create_retentions.py
tests/system-test/1-insert/create_retentions.py
+38
-36
tests/system-test/1-insert/time_range_wise.py
tests/system-test/1-insert/time_range_wise.py
+74
-38
tests/system-test/2-query/join.py
tests/system-test/2-query/join.py
+1
-1
tests/system-test/2-query/join2.py
tests/system-test/2-query/join2.py
+1
-1
tests/system-test/2-query/substr.py
tests/system-test/2-query/substr.py
+1
-1
未找到文件。
tests/system-test/1-insert/create_retentions.py
浏览文件 @
50b61208
...
...
@@ -51,12 +51,28 @@ class DataSet:
binary_data
:
List
[
str
]
=
None
nchar_data
:
List
[
str
]
=
None
def
__post_init__
(
self
):
self
.
ts_data
=
[]
self
.
int_data
=
[]
self
.
bint_data
=
[]
self
.
sint_data
=
[]
self
.
tint_data
=
[]
self
.
int_un_data
=
[]
self
.
bint_un_data
=
[]
self
.
sint_un_data
=
[]
self
.
tint_un_data
=
[]
self
.
float_data
=
[]
self
.
double_data
=
[]
self
.
bool_data
=
[]
self
.
binary_data
=
[]
self
.
nchar_data
=
[]
class
TDTestCase
:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
Tru
e
)
tdSql
.
init
(
conn
.
cursor
(),
Fals
e
)
@
property
def
create_databases_sql_err
(
self
):
...
...
@@ -87,28 +103,28 @@ class TDTestCase:
@
property
def
create_stable_sql_err
(
self
):
return
[
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(ceil) watermark 1s maxdelay 1m"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(ceil) watermark 1s max
_
delay 1m"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(count) watermark 1min"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) maxdelay -1s"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) max
_
delay -1s"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) watermark -1m"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) watermark 1m "
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) max
delay 1m "
,
#
f"create stable stb1 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) watermark 1m ",
# f"create stable stb1 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) max_
delay 1m ",
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int,
{
BINARY_COL
}
binary(16)) tags (tag1 int) rollup(avg) watermark 1s"
,
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int,
{
BINARY_COL
}
nchar(16)) tags (tag1 int) rollup(avg) maxdelay 1m"
,
# f"create table ntb_1 ({PRIMARY_COL} timestamp, {INT_COL} int, {BINARY_COL} nchar(16)) rollup(avg) watermark 1s maxdelay 1s",
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int,
{
BINARY_COL
}
nchar(16)) tags (tag1 int) rollup(avg) max
_
delay 1m"
,
# f"create table ntb_1 ({PRIMARY_COL} timestamp, {INT_COL} int, {BINARY_COL} nchar(16)) rollup(avg) watermark 1s max
_
delay 1s",
# f"create stable stb2 ({PRIMARY_COL} timestamp, {INT_COL} int, {BINARY_COL} nchar(16)) tags (tag1 int) " ,
# f"create stable stb2 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) " ,
# f"create stable stb2 ({PRIMARY_COL} timestamp, {INT_COL} int) " ,
# f"create stable stb2 ({PRIMARY_COL} timestamp, {INT_COL} int, {BINARY_COL} nchar(16)) " ,
# watermark, maxdelay: [0, 900000], [ms, s, m, ?]
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) maxdelay 1u"
,
# watermark, max
_
delay: [0, 900000], [ms, s, m, ?]
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) max
_
delay 1u"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) watermark 1b"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) watermark 900001ms"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) maxdelay 16m"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) maxdelay 901s"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) maxdelay 1h"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) maxdelay 0.2h"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) max
_
delay 16m"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) max
_
delay 901s"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) max
_
delay 1h"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) max
_
delay 0.2h"
,
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) watermark 0.002d"
,
]
...
...
@@ -117,11 +133,11 @@ class TDTestCase:
def
create_stable_sql_current
(
self
):
return
[
f
"create stable stb1 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(avg)"
,
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) watermark 5s maxdelay 1m"
,
f
"create stable stb3 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(max) watermark 5s maxdelay 1m"
,
f
"create stable stb4 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(sum) watermark 5s maxdelay 1m"
,
# f"create stable stb5 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) rollup(last) watermark 5s maxdelay 1m",
# f"create stable stb6 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) rollup(first) watermark 5s maxdelay 1m",
f
"create stable stb2 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(min) watermark 5s max
_
delay 1m"
,
f
"create stable stb3 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(max) watermark 5s max
_
delay 1m"
,
f
"create stable stb4 (
{
PRIMARY_COL
}
timestamp,
{
INT_COL
}
int) tags (tag1 int) rollup(sum) watermark 5s max
_
delay 1m"
,
# f"create stable stb5 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) rollup(last) watermark 5s max
_
delay 1m",
# f"create stable stb6 ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int) rollup(first) watermark 5s max
_
delay 1m",
]
def
test_create_stb
(
self
):
...
...
@@ -135,7 +151,7 @@ class TDTestCase:
tdSql
.
checkRows
(
len
(
self
.
create_stable_sql_current
))
# tdSql.execute("use db") # because db is a noraml database, not a rollup database, should not be able to create a rollup database
# tdSql.error(f"create stable nor_db_rollup_stb ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int)
file_factor 5.0
")
# tdSql.error(f"create stable nor_db_rollup_stb ({PRIMARY_COL} timestamp, {INT_COL} int) tags (tag1 int)
watermark 5s max_delay 1m
")
def
test_create_databases
(
self
):
...
...
@@ -177,21 +193,6 @@ class TDTestCase:
def
__data_set
(
self
,
rows
):
data_set
=
DataSet
()
# neg_data_set = DataSet()
data_set
.
ts_data
=
[]
data_set
.
int_data
=
[]
data_set
.
bint_data
=
[]
data_set
.
sint_data
=
[]
data_set
.
tint_data
=
[]
data_set
.
int_un_data
=
[]
data_set
.
bint_un_data
=
[]
data_set
.
sint_un_data
=
[]
data_set
.
tint_un_data
=
[]
data_set
.
float_data
=
[]
data_set
.
double_data
=
[]
data_set
.
bool_data
=
[]
data_set
.
binary_data
=
[]
data_set
.
nchar_data
=
[]
for
i
in
range
(
rows
):
data_set
.
ts_data
.
append
(
NOW
+
1
*
(
rows
-
i
))
...
...
@@ -226,6 +227,7 @@ class TDTestCase:
return
data_set
def
__insert_data
(
self
):
tdLog
.
printNoPrefix
(
"==========step: start inser data into tables now....."
)
data
=
self
.
__data_set
(
rows
=
self
.
rows
)
# now_time = int(datetime.datetime.timestamp(datetime.datetime.now()) * 1000)
...
...
@@ -264,10 +266,10 @@ class TDTestCase:
def
run
(
self
):
self
.
rows
=
10
tdSql
.
prepare
()
tdLog
.
printNoPrefix
(
"==========step0:all check"
)
#
self.all_test()
self
.
all_test
()
tdLog
.
printNoPrefix
(
"==========step1:create table in normal database"
)
tdSql
.
prepare
()
...
...
tests/system-test/1-insert/time_range_wise.py
浏览文件 @
50b61208
...
...
@@ -7,6 +7,7 @@ from util.sql import *
from
util.cases
import
*
from
util.dnodes
import
*
from
util.constant
import
*
from
...pytest.util.sql
import
*
PRIMARY_COL
=
"ts"
...
...
@@ -25,8 +26,6 @@ BINARY_COL = "c_binary"
NCHAR_COL
=
"c_nchar"
TS_COL
=
"c_ts"
NUM_COL
=
[
INT_COL
,
BINT_COL
,
SINT_COL
,
TINT_COL
,
FLOAT_COL
,
DOUBLE_COL
,
]
CHAR_COL
=
[
BINARY_COL
,
NCHAR_COL
,
]
BOOLEAN_COL
=
[
BOOL_COL
,
]
...
...
@@ -36,6 +35,12 @@ TS_TYPE_COL = [TS_COL, ]
TIME_STEP
=
10000
NOW
=
int
(
datetime
.
datetime
.
timestamp
(
datetime
.
datetime
.
now
())
*
1000
)
# init db/table
DBNAME
=
"db"
STBNAME
=
"stb1"
CTBNAME
=
"ct1"
NTBNAME
=
"nt1"
@
dataclass
class
DataSet
:
...
...
@@ -73,19 +78,20 @@ class DataSet:
@
dataclass
class
SMAschema
:
creation
:
str
=
"CREATE"
index_name
:
str
=
"sma_index_1"
index_flag
:
str
=
"SMA INDEX"
operator
:
str
=
"ON"
tbname
:
str
=
None
watermark
:
str
=
None
maxdelay
:
str
=
None
func
:
Tuple
[
str
]
=
None
interval
:
Tuple
[
str
]
=
None
sliding
:
str
=
None
other
:
Any
=
None
drop
:
str
=
"DROP"
drop_flag
:
str
=
"INDEX"
creation
:
str
=
"CREATE"
index_name
:
str
=
"sma_index_1"
index_flag
:
str
=
"SMA INDEX"
operator
:
str
=
"ON"
tbname
:
str
=
None
watermark
:
str
=
"5s"
max_delay
:
str
=
"6m"
func
:
Tuple
[
str
]
=
None
interval
:
Tuple
[
str
]
=
(
"6m"
,
"10s"
)
sliding
:
str
=
"6m"
other
:
Any
=
None
drop
:
str
=
"DROP"
drop_flag
:
str
=
"INDEX"
querySmaOptimize
:
int
=
1
def
__post_init__
(
self
):
if
isinstance
(
self
.
other
,
dict
):
...
...
@@ -111,8 +117,8 @@ class SMAschema:
self
.
watermark
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"max
delay"
and
isinstance
(
v
,
str
)
and
not
self
.
max
delay
:
self
.
maxdelay
=
v
if
k
.
lower
()
==
"max
_delay"
and
isinstance
(
v
,
str
)
and
not
self
.
max_
delay
:
self
.
max
_
delay
=
v
del
self
.
other
[
k
]
if
k
.
lower
()
==
"functions"
and
isinstance
(
v
,
tuple
)
and
not
self
.
func
:
...
...
@@ -133,6 +139,7 @@ class SMAschema:
class
TDTestCase
:
updatecfgDict
=
{
"querySmaOptimize"
:
1
}
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
...
...
@@ -160,8 +167,8 @@ class TDTestCase:
sql
+=
f
" sliding(
{
sma
.
sliding
}
)"
if
sma
.
watermark
:
sql
+=
f
" watermark
{
sma
.
watermark
}
"
if
sma
.
maxdelay
:
sql
+=
f
" max
delay
{
sma
.
max
delay
}
"
if
sma
.
max
_
delay
:
sql
+=
f
" max
_delay
{
sma
.
max_
delay
}
"
if
isinstance
(
sma
.
other
,
dict
):
for
k
,
v
in
sma
.
other
.
items
():
if
isinstance
(
v
,
tuple
)
or
isinstance
(
v
,
list
):
...
...
@@ -171,26 +178,36 @@ class TDTestCase:
if
isinstance
(
sma
.
other
,
tuple
)
or
isinstance
(
sma
.
other
,
list
):
sql
+=
" "
.
join
(
sma
.
other
)
if
isinstance
(
sma
.
other
,
int
)
or
isinstance
(
sma
.
other
,
float
)
or
isinstance
(
sma
.
other
,
str
):
sql
+=
sma
.
other
sql
+=
f
"
{
sma
.
other
}
"
return
sql
def
__check_sma_func
(
self
,
func
:
tuple
):
sma_func_support
=
[
"min"
,
"max"
,
"avg"
]
if
not
isinstance
(
func
,
str
)
or
not
isinstance
(
func
,
tuple
)
or
not
isinstance
(
func
,
list
):
return
False
if
isinstance
(
func
,
str
)
:
if
func
.
split
(
"("
)[
0
]
not
in
sma_func_support
:
return
False
def
sma_create_check
(
self
,
sma
:
SMAschema
):
if
self
.
updatecfgDict
[
"querySmaOptimize"
]
==
0
:
tdSql
.
error
(
self
.
__create_sma_index
(
sma
))
tdSql
.
query
(
"show stables"
)
stb_in_list
=
False
for
row
in
tdSql
.
queryResult
:
if
sma
.
tbname
==
row
[
0
]:
stb_in_list
=
True
break
if
not
stb_in_list
:
tdSql
.
error
(
self
.
__create_sma_index
(
sma
))
if
not
sma
.
creation
:
if
not
sma
.
creation
or
not
isinstance
(
sma
.
creation
,
str
)
or
sma
.
creation
.
upper
()
!=
"CREATE"
:
tdSql
.
error
(
self
.
__create_sma_index
(
sma
))
if
not
sma
.
index_flag
:
if
not
sma
.
index_flag
or
not
isinstance
(
sma
.
index_flag
,
str
)
or
sma
.
index_flag
.
upper
()
!=
"SMA INDEX"
:
tdSql
.
error
(
self
.
__create_sma_index
(
sma
))
if
not
sma
.
index_name
:
if
not
sma
.
index_name
or
not
isinstance
(
sma
.
index_name
,
str
)
:
tdSql
.
error
(
self
.
__create_sma_index
(
sma
))
if
not
sma
.
operator
:
if
not
sma
.
operator
or
not
isinstance
(
sma
.
operator
,
str
)
or
sma
.
operator
.
upper
()
!=
"ON"
:
tdSql
.
error
(
self
.
__create_sma_index
(
sma
))
if
not
sma
.
tbname
:
tdSql
.
error
(
self
.
__create_sma_index
(
sma
))
...
...
@@ -203,13 +220,36 @@ class TDTestCase:
if
sma
.
other
:
tdSql
.
error
(
self
.
__create_sma_index
(
sma
))
@
property
def
__create_sma_sql
(
self
):
err_sqls
=
[]
cur_sqls
=
[]
# err_set
# case 1: required fields check
err_sqls
.
append
(
SMAschema
(
creation
=
""
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
index_name
=
""
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
index_flag
=
""
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
operator
=
""
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
tbname
=
""
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
func
=
""
,
tbname
=
STBNAME
)
)
err_sqls
.
append
(
SMAschema
(
interval
=
""
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
err_sqls
.
append
(
SMAschema
(
sliding
=
""
,
tbname
=
STBNAME
,
func
=
(
f
"min(
{
INT_COL
}
)"
,
f
"max(
{
INT_COL
}
)"
)
)
)
return
err_sqls
,
cur_sqls
def
test_create_sma
(
self
):
err_sqls
,
cur_sqls
=
self
.
__create_sma_sql
for
err_sql
in
err_sqls
:
self
.
sma_create_check
(
err_sql
)
def
all_test
(
self
):
self
.
test_create_sma
()
pass
def
__create_tb
(
self
):
tdLog
.
printNoPrefix
(
"==========step: create table"
)
create_stb_sql
=
f
'''create table
stb1
(
create_stb_sql
=
f
'''create table
{
STBNAME
}
(
ts timestamp,
{
INT_COL
}
int,
{
BINT_COL
}
bigint,
{
SINT_COL
}
smallint,
{
TINT_COL
}
tinyint,
{
FLOAT_COL
}
float,
{
DOUBLE_COL
}
double,
{
BOOL_COL
}
bool,
{
BINARY_COL
}
binary(16),
{
NCHAR_COL
}
nchar(32),
{
TS_COL
}
timestamp,
...
...
@@ -217,7 +257,7 @@ class TDTestCase:
{
INT_UN_COL
}
int unsigned,
{
BINT_UN_COL
}
bigint unsigned
) tags (tag1 int)
'''
create_ntb_sql
=
f
'''create table
t1
(
create_ntb_sql
=
f
'''create table
{
NTBNAME
}
(
ts timestamp,
{
INT_COL
}
int,
{
BINT_COL
}
bigint,
{
SINT_COL
}
smallint,
{
TINT_COL
}
tinyint,
{
FLOAT_COL
}
float,
{
DOUBLE_COL
}
double,
{
BOOL_COL
}
bool,
{
BINARY_COL
}
binary(16),
{
NCHAR_COL
}
nchar(32),
{
TS_COL
}
timestamp,
...
...
@@ -253,6 +293,7 @@ class TDTestCase:
return
data_set
def
__insert_data
(
self
):
tdLog
.
printNoPrefix
(
"==========step: start inser data into tables now....."
)
data
=
self
.
__data_set
(
rows
=
self
.
rows
)
# now_time = int(datetime.datetime.timestamp(datetime.datetime.now()) * 1000)
...
...
@@ -278,7 +319,7 @@ class TDTestCase:
tdSql
.
execute
(
f
"insert into ct4 values (
{
NOW
-
i
*
int
(
TIME_STEP
*
0.8
)
}
,
{
row_data
}
)"
)
tdSql
.
execute
(
f
"insert into
t1
values (
{
NOW
-
i
*
int
(
TIME_STEP
*
1.2
)
}
,
{
row_data
}
)"
)
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
i
*
int
(
TIME_STEP
*
1.2
)
}
,
{
row_data
}
)"
)
tdSql
.
execute
(
f
"insert into ct2 values (
{
NOW
+
int
(
TIME_STEP
*
0.6
)
}
,
{
null_data
}
)"
)
...
...
@@ -295,28 +336,23 @@ class TDTestCase:
f
"insert into ct4 values (
{
NOW
-
self
.
rows
*
int
(
TIME_STEP
*
0.39
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
t1
values (
{
NOW
+
int
(
TIME_STEP
*
1.2
)
}
,
{
null_data
}
)"
)
f
"insert into
{
NTBNAME
}
values (
{
NOW
+
int
(
TIME_STEP
*
1.2
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
t1
values (
{
NOW
-
(
self
.
rows
+
1
)
*
int
(
TIME_STEP
*
1.2
)
}
,
{
null_data
}
)"
)
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
(
self
.
rows
+
1
)
*
int
(
TIME_STEP
*
1.2
)
}
,
{
null_data
}
)"
)
tdSql
.
execute
(
f
"insert into
t1
values (
{
NOW
-
self
.
rows
*
int
(
TIME_STEP
*
0.59
)
}
,
{
null_data
}
)"
)
f
"insert into
{
NTBNAME
}
values (
{
NOW
-
self
.
rows
*
int
(
TIME_STEP
*
0.59
)
}
,
{
null_data
}
)"
)
def
run
(
self
):
sma1
=
SMAschema
(
func
=
(
"min(c1)"
,
"max(c2)"
))
sql1
=
self
.
__create_sma_index
(
sma1
)
print
(
"================"
)
print
(
sql1
)
# a = DataSet()
# return
self
.
rows
=
10
tdLog
.
printNoPrefix
(
"==========step0:all check"
)
# self.all_test()
tdLog
.
printNoPrefix
(
"==========step1:create table in normal database"
)
tdSql
.
prepare
()
self
.
__create_tb
()
self
.
__insert_data
()
self
.
all_test
()
return
tdLog
.
printNoPrefix
(
"==========step2:create table in rollup database"
)
...
...
tests/system-test/2-query/join.py
浏览文件 @
50b61208
...
...
@@ -28,7 +28,7 @@ class TDTestCase:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
Tru
e
)
tdSql
.
init
(
conn
.
cursor
(),
Fals
e
)
def
__query_condition
(
self
,
tbname
):
query_condition
=
[]
...
...
tests/system-test/2-query/join2.py
浏览文件 @
50b61208
...
...
@@ -28,7 +28,7 @@ class TDTestCase:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
(),
Tru
e
)
tdSql
.
init
(
conn
.
cursor
(),
Fals
e
)
def
__query_condition
(
self
,
tbname
):
query_condition
=
[]
...
...
tests/system-test/2-query/substr.py
浏览文件 @
50b61208
...
...
@@ -31,7 +31,7 @@ class TDTestCase:
def
init
(
self
,
conn
,
logSql
):
tdLog
.
debug
(
f
"start to excute
{
__file__
}
"
)
tdSql
.
init
(
conn
.
cursor
())
tdSql
.
init
(
conn
.
cursor
()
,
False
)
def
__substr_condition
(
self
):
# sourcery skip: extract-method
substr_condition
=
[]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录