Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
76482161
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看板
提交
76482161
编写于
7月 12, 2022
作者:
S
slzhou@taodata.com
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat: modify test case that defaults to table scan when query tags
上级
6f501bb3
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
17 addition
and
38 deletion
+17
-38
tests/system-test/2-query/abs.py
tests/system-test/2-query/abs.py
+3
-3
tests/system-test/2-query/json_tag.py
tests/system-test/2-query/json_tag.py
+14
-35
未找到文件。
tests/system-test/2-query/abs.py
浏览文件 @
76482161
...
...
@@ -538,9 +538,9 @@ class TDTestCase:
tdSql
.
query
(
"select c1 ,t1 from stb1 where t1 =0 "
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select t1 from stb1 where t1 >0 "
)
tdSql
.
checkRows
(
3
)
tdSql
.
checkRows
(
12
)
tdSql
.
query
(
"select t1 from stb1 where t1 =3 "
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkRows
(
1
2
)
# tdSql.query("select sum(t1) from (select c1 ,t1 from stb1)")
# tdSql.checkData(0,0,61)
# tdSql.query("select distinct(c1) ,t1 from stb1")
...
...
@@ -550,7 +550,7 @@ class TDTestCase:
# tag filter with abs function
tdSql
.
query
(
"select t1 from stb1 where abs(t1)=1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkRows
(
0
)
tdSql
.
query
(
"select t1 from stb1 where abs(c1+t1)=1"
)
tdSql
.
checkRows
(
1
)
tdSql
.
checkData
(
0
,
0
,
0
)
...
...
tests/system-test/2-query/json_tag.py
浏览文件 @
76482161
...
...
@@ -57,7 +57,7 @@ class TDTestCase:
# test duplicate key using the first one. elimate empty key
tdSql
.
execute
(
"CREATE TABLE if not exists jsons1_8 using jsons1 tags('{
\"
tag1
\"
:null,
\"
tag1
\"
:true,
\"
tag1
\"
:45,
\"
1tag$
\"
:2,
\"
\"
:90,
\"\"
:32}')"
)
tdSql
.
query
(
"select jtag from jsons1_8"
)
tdSql
.
check
Data
(
0
,
0
,
'{" ":90,"1tag$":2,"tag1":null}'
)
tdSql
.
check
Rows
(
0
);
tdSql
.
query
(
"select ts,jtag from jsons1 order by ts limit 2,3"
)
tdSql
.
checkData
(
0
,
0
,
'2020-06-02 09:17:08.000'
)
...
...
@@ -153,38 +153,17 @@ class TDTestCase:
#test scalar operation
tdSql
.
query
(
"select jtag contains 'tag1',jtag->'tag1' from jsons1 order by jtag->'tag1'"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
False
)
tdSql
.
checkData
(
5
,
0
,
True
)
tdSql
.
checkData
(
12
,
0
,
True
)
tdSql
.
checkRows
(
9
)
tdSql
.
query
(
"select jtag->'tag1' like 'fe%',jtag->'tag1' from jsons1 order by jtag->'tag1'"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
10
,
0
,
False
)
tdSql
.
checkData
(
11
,
0
,
False
)
tdSql
.
checkData
(
12
,
0
,
True
)
tdSql
.
checkRows
(
9
)
tdSql
.
query
(
"select jtag->'tag1' not like 'fe%',jtag->'tag1' from jsons1 order by jtag->'tag1'"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
10
,
0
,
False
)
tdSql
.
checkData
(
11
,
0
,
True
)
tdSql
.
checkData
(
12
,
0
,
False
)
tdSql
.
checkRows
(
9
)
tdSql
.
query
(
"select jtag->'tag1' match 'fe',jtag->'tag1' from jsons1 order by jtag->'tag1'"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
10
,
0
,
False
)
tdSql
.
checkData
(
11
,
0
,
False
)
tdSql
.
checkData
(
12
,
0
,
True
)
tdSql
.
checkRows
(
9
)
tdSql
.
query
(
"select jtag->'tag1' nmatch 'fe',jtag->'tag1' from jsons1 order by jtag->'tag1'"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
10
,
0
,
False
)
tdSql
.
checkData
(
11
,
0
,
True
)
tdSql
.
checkData
(
12
,
0
,
False
)
tdSql
.
checkRows
(
9
)
tdSql
.
query
(
"select jtag->'tag1',jtag->'tag1'>='a' from jsons1 order by jtag->'tag1'"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
checkData
(
0
,
1
,
False
)
tdSql
.
checkData
(
7
,
0
,
"false"
)
tdSql
.
checkData
(
7
,
1
,
False
)
tdSql
.
checkData
(
8
,
1
,
False
)
tdSql
.
checkData
(
12
,
1
,
True
)
tdSql
.
checkRows
(
9
)
# test select normal column
tdSql
.
query
(
"select dataint from jsons1 order by dataint"
)
...
...
@@ -195,7 +174,7 @@ class TDTestCase:
tdSql
.
query
(
"select * from jsons1"
)
tdSql
.
checkRows
(
9
)
tdSql
.
query
(
"select jtag from jsons1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkRows
(
9
)
tdSql
.
query
(
"select * from jsons1 where jtag is null"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"select * from jsons1 where jtag is not null"
)
...
...
@@ -227,7 +206,7 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
query
(
"select jtag->'tag1' from jsons1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
checkRows
(
9
)
# test header name
res
=
tdSql
.
getColNameList
(
"select jtag->'tag1' from jsons1"
)
cname_list
=
[]
...
...
@@ -415,7 +394,7 @@ class TDTestCase:
# test distinct
tdSql
.
execute
(
"insert into jsons1_14 using jsons1 tags('{
\"
tag1
\"
:
\"
收到货
\"
,
\"
tag2
\"
:
\"\"
,
\"
tag3
\"
:null}') values(1591062628000, 2, NULL, '你就会', 'dws')"
)
tdSql
.
query
(
"select distinct jtag->'tag1' from jsons1"
)
tdSql
.
checkRows
(
8
)
tdSql
.
checkRows
(
7
)
# tdSql.query("select distinct jtag from jsons1")
# tdSql.checkRows(9)
...
...
@@ -523,12 +502,12 @@ class TDTestCase:
# union all
tdSql
.
query
(
"select jtag->'tag1' from jsons1 union all select jtag->'tag2' from jsons2"
)
tdSql
.
checkRows
(
1
7
)
tdSql
.
checkRows
(
1
3
)
tdSql
.
query
(
"select jtag->'tag1' from jsons1_1 union all select jtag->'tag2' from jsons2_1"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select jtag->'tag1' from jsons1_1 union all select jtag->'tag1' from jsons2_1"
)
tdSql
.
checkRows
(
2
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select dataint,jtag->'tag1',tbname from jsons1 union all select dataint,jtag->'tag1',tbname from jsons2"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select dataint,jtag,tbname from jsons1 union all select dataint,jtag,tbname from jsons2"
)
...
...
@@ -709,7 +688,7 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
None
)
tdSql
.
execute
(
"CREATE TABLE if not exists jsons1_20 using jsons1 tags(NULL)"
)
tdSql
.
query
(
"select jtag from jsons1_20"
)
tdSql
.
check
Data
(
0
,
0
,
None
)
tdSql
.
check
Rows
(
0
)
tdSql
.
execute
(
"insert into jsons1_21 using jsons1 tags(NULL) values(1591061628000, 11, false, '你就会','')"
)
tdSql
.
query
(
"select jtag from jsons1_21"
)
tdSql
.
checkData
(
0
,
0
,
None
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录