Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
757ac9b1
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1181
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
提交
757ac9b1
编写于
5月 30, 2023
作者:
wmmhello
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:add test cases
上级
5d2c78ba
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
70 addition
and
2 deletion
+70
-2
tests/system-test/7-tmq/stbFilterWhere.py
tests/system-test/7-tmq/stbFilterWhere.py
+70
-2
未找到文件。
tests/system-test/7-tmq/stbFilterWhere.py
浏览文件 @
757ac9b1
...
@@ -56,7 +56,7 @@ class TDTestCase:
...
@@ -56,7 +56,7 @@ class TDTestCase:
startTs
=
paraDict
[
"startTs"
],
ctbStartIdx
=
paraDict
[
'ctbStartIdx'
])
startTs
=
paraDict
[
"startTs"
],
ctbStartIdx
=
paraDict
[
'ctbStartIdx'
])
return
return
def
tmqCaseError
(
self
,
topicName
,
condition
):
def
tmqCase
_column
Error
(
self
,
topicName
,
condition
):
tdLog
.
printNoPrefix
(
"======== test case error: "
)
tdLog
.
printNoPrefix
(
"======== test case error: "
)
paraDict
=
{
'dbName'
:
'dbt'
,
paraDict
=
{
'dbName'
:
'dbt'
,
'dropFlag'
:
1
,
'dropFlag'
:
1
,
...
@@ -140,14 +140,82 @@ class TDTestCase:
...
@@ -140,14 +140,82 @@ class TDTestCase:
tdLog
.
printNoPrefix
(
"======== test case end ...... "
)
tdLog
.
printNoPrefix
(
"======== test case end ...... "
)
def
tmqCase_addNewTable_dropTag
(
self
,
topicName
,
condition
):
tdLog
.
printNoPrefix
(
"======== test case1: "
)
paraDict
=
{
'dbName'
:
'dbt'
,
'dropFlag'
:
1
,
'event'
:
''
,
'vgroups'
:
4
,
'replica'
:
1
,
'stbName'
:
'stb'
,
'colPrefix'
:
'c'
,
'tagPrefix'
:
't'
,
'colSchema'
:
[{
'type'
:
'INT'
,
'count'
:
2
},
{
'type'
:
'binary'
,
'len'
:
20
,
'count'
:
1
}],
'tagSchema'
:
[{
'type'
:
'INT'
,
'count'
:
1
},
{
'type'
:
'binary'
,
'len'
:
20
,
'count'
:
1
}],
'ctbPrefix'
:
'ctb'
,
'ctbStartIdx'
:
0
,
'ctbNum'
:
10
,
'rowsPerTbl'
:
10000
,
'batchNum'
:
100
,
'startTs'
:
1640966400000
,
# 2022-01-01 00:00:00.000
'pollDelay'
:
2
,
'showMsg'
:
1
,
'showRow'
:
1
}
expectRowsList
=
[]
tmqCom
.
initConsumerTable
()
tdLog
.
info
(
"create topics from stb with tag filter"
)
topicString
=
"create topic %s as stable %s.%s where %s"
%
(
topicName
,
paraDict
[
'dbName'
],
paraDict
[
'stbName'
],
condition
)
tdLog
.
info
(
"create topic sql: %s"
%
topicString
)
tdSql
.
execute
(
topicString
)
queryString
=
"select * from %s.%s where %s"
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
],
condition
)
tdSql
.
query
(
queryString
)
expectRowsList
.
append
(
tdSql
.
getRows
()
+
1
)
# init consume info, and start tmq_sim, then check consume result
tdLog
.
info
(
"insert consume info to consume processor"
)
consumerId
=
0
expectrowcnt
=
paraDict
[
"rowsPerTbl"
]
*
paraDict
[
"ctbNum"
]
topicList
=
topicName
ifcheckdata
=
0
ifManualCommit
=
1
keyList
=
'group.id:cgrp1, enable.auto.commit:false, auto.commit.interval.ms:6000, auto.offset.reset:earliest'
tmqCom
.
insertConsumerInfo
(
consumerId
,
expectrowcnt
,
topicList
,
keyList
,
ifcheckdata
,
ifManualCommit
)
tdLog
.
info
(
"start consume processor"
)
tmqCom
.
startTmqSimProcess
(
paraDict
[
'pollDelay'
],
paraDict
[
"dbName"
],
paraDict
[
'showMsg'
],
paraDict
[
'showRow'
])
#add new table with one data
tdLog
.
info
(
"start insert data"
)
insertString
=
"insert into %s.tmp using %s.%s tags(1, 1, 1, 't4', 't5') values(now, 1, 1, 1, 'c4', 'c5', now)"
%
(
paraDict
[
'dbName'
],
paraDict
[
'dbName'
],
paraDict
[
'stbName'
])
tdSql
.
execute
(
insertString
)
#test drop tag
tdSql
.
error
(
"alter stable %s.%s drop tag t1"
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
]))
tdSql
.
execute
(
"alter stable %s.%s drop tag t2"
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
]))
tdSql
.
execute
(
"alter stable %s.%s drop column c2"
%
(
paraDict
[
'dbName'
],
paraDict
[
'stbName'
]))
tdLog
.
info
(
"wait the consume result"
)
expectRows
=
1
resultList
=
tmqCom
.
selectConsumeResult
(
expectRows
)
if
expectRowsList
[
0
]
!=
resultList
[
0
]:
tdLog
.
info
(
"expect consume rows: %d, act consume rows: %d"
%
(
expectRowsList
[
0
],
resultList
[
0
]))
tdLog
.
exit
(
"0 tmq consume rows error!"
)
tdLog
.
printNoPrefix
(
"======== test case1 end ...... "
)
def
run
(
self
):
def
run
(
self
):
tdSql
.
prepare
()
tdSql
.
prepare
()
self
.
prepareTestEnv
()
self
.
prepareTestEnv
()
self
.
tmqCaseError
(
"t1"
,
"c1 = 4 and t1 = 3"
)
self
.
tmqCase
_column
Error
(
"t1"
,
"c1 = 4 and t1 = 3"
)
self
.
tmqCase
(
"t2"
,
"2 > 1"
)
self
.
tmqCase
(
"t2"
,
"2 > 1"
)
self
.
tmqCase
(
"t3"
,
"t4 = 'beijing'"
)
self
.
tmqCase
(
"t3"
,
"t4 = 'beijing'"
)
self
.
tmqCase
(
"t4"
,
"t4 > t3"
)
self
.
tmqCase
(
"t4"
,
"t4 > t3"
)
self
.
tmqCase
(
"t5"
,
"t3 = t4"
)
self
.
tmqCase
(
"t5"
,
"t3 = t4"
)
self
.
tmqCase_addNewTable_dropTag
(
"t6"
,
"t1 = 1"
)
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录