Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
045f0eb9
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22017
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看板
提交
045f0eb9
编写于
6月 15, 2022
作者:
dengyihao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix jsons filter error
上级
08c45a5e
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
30 addition
and
29 deletion
+30
-29
tests/system-test/2-query/json_tag.py
tests/system-test/2-query/json_tag.py
+30
-29
未找到文件。
tests/system-test/2-query/json_tag.py
浏览文件 @
045f0eb9
...
...
@@ -244,8 +244,8 @@ class TDTestCase:
tdSql
.
query
(
"select * from jsons1 where jtag->'tag2'!='beijing'"
)
tdSql
.
checkRows
(
5
)
#open
#
tdSql.query("select * from jsons1 where jtag->'tag2'=''")
#
tdSql.checkRows(2)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag2'=''"
)
tdSql
.
checkRows
(
2
)
#
# # where json value is int
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'=5"
)
...
...
@@ -254,10 +254,10 @@ class TDTestCase:
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'=10"
)
tdSql
.
checkRows
(
0
)
# open
#
tdSql.query("select * from jsons1 where jtag->'tag1'<54")
#tdSql.checkRows(3
)
#
tdSql.query("select * from jsons1 where jtag->'tag1'<=11")
#tdSql.checkRows(3
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'<54"
)
tdSql
.
checkRows
(
4
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'<=11"
)
tdSql
.
checkRows
(
4
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'>4"
)
tdSql
.
checkRows
(
2
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'>=5"
)
...
...
@@ -271,30 +271,30 @@ class TDTestCase:
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'=1.232"
)
tdSql
.
checkRows
(
1
)
# open
#
tdSql.query("select * from jsons1 where jtag->'tag1'<1.232")
#tdSql.checkRows(0
)
#
tdSql.query("select * from jsons1 where jtag->'tag1'<=1.232")
#tdSql.checkRows(1
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'<1.232"
)
tdSql
.
checkRows
(
1
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'<=1.232"
)
tdSql
.
checkRows
(
2
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'>1.23"
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'>=1.232"
)
tdSql
.
checkRows
(
3
)
# open
#
tdSql.query("select * from jsons1 where jtag->'tag1'!=1.232")
#tdSql.checkRows(2
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'!=1.232"
)
tdSql
.
checkRows
(
6
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'!=3.232"
)
tdSql
.
checkRows
(
7
)
#tdSql.error("select * from jsons1 where jtag->'tag1'/0=3")
#tdSql.error("select * from jsons1 where jtag->'tag1'/5=1")
#
# # where json value is bool
#
tdSql.query("select * from jsons1 where jtag->'tag1'=true")
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'=true"
)
# open
#
tdSql.checkRows(0)
tdSql
.
checkRows
(
0
)
#tdSql.query("select * from jsons1 where jtag->'tag1'=false")
#tdSql.checkRows(1)
#
tdSql.query("select * from jsons1 where jtag->'tag1'!=false")
#tdSql.checkRows(0
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1'!=false"
)
tdSql
.
checkRows
(
3
)
#tdSql.error("select * from jsons1 where jtag->'tag1'>false")
#
# # where json value is null
...
...
@@ -304,17 +304,17 @@ class TDTestCase:
#
# # where json key is null
# open
#
tdSql.query("select * from jsons1 where jtag->'tag_no_exist'=3")
#
tdSql.checkRows(0)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag_no_exist'=3"
)
tdSql
.
checkRows
(
0
)
#
# # where json value is not exist
#
tdSql.query("select * from jsons1 where jtag->'tag1' is null")
#
tdSql.checkData(0, 0, 'jsons1_9')
#tdSql.checkRows(1
)
#
tdSql.query("select * from jsons1 where jtag->'tag4' is null")
#
tdSql.checkRows(9)
#
tdSql.query("select * from jsons1 where jtag->'tag3' is not null")
#tdSql.checkRows(4
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1' is null"
)
tdSql
.
checkData
(
0
,
0
,
'jsons1_9'
)
tdSql
.
checkRows
(
2
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag4' is null"
)
tdSql
.
checkRows
(
9
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag3' is not null"
)
tdSql
.
checkRows
(
3
)
#
# # test contains
tdSql
.
query
(
"select * from jsons1 where jtag contains 'tag1'"
)
...
...
@@ -344,10 +344,10 @@ class TDTestCase:
#
#
# # test with between and
#
tdSql.query("select * from jsons1 where jtag->'tag1' between 1 and 30")
#
tdSql.checkRows(3)
#
tdSql.query("select * from jsons1 where jtag->'tag1' between 'femail' and 'beijing'")
#
tdSql.checkRows(2)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1' between 1 and 30"
)
tdSql
.
checkRows
(
3
)
tdSql
.
query
(
"select * from jsons1 where jtag->'tag1' between 'femail' and 'beijing'"
)
tdSql
.
checkRows
(
2
)
#
# # test with tbname/normal column
tdSql
.
query
(
"select * from jsons1 where tbname = 'jsons1_1'"
)
...
...
@@ -362,6 +362,7 @@ class TDTestCase:
#
# # test where condition like
# open
# syntax error
#tdSql.query("select *,tbname from jsons1 where jtag->'tag2' like 'bei%'")
#tdSql.checkRows(2)
#tdSql.query("select *,tbname from jsons1 where jtag->'tag1' like 'fe%' and jtag->'tag2' is not null")
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录