Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
31abaa31
TDengine
项目概览
taosdata
/
TDengine
12 个月 前同步成功
通知
1180
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,发现更多精彩内容 >>
提交
31abaa31
编写于
8月 01, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add test cases
上级
14deef3a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
66 addition
and
15 deletion
+66
-15
tests/system-test/2-query/csum.py
tests/system-test/2-query/csum.py
+21
-7
tests/system-test/2-query/statecount.py
tests/system-test/2-query/statecount.py
+45
-8
未找到文件。
tests/system-test/2-query/csum.py
浏览文件 @
31abaa31
...
@@ -279,14 +279,14 @@ class TDTestCase:
...
@@ -279,14 +279,14 @@ class TDTestCase:
tdSql
.
error
(
self
.
csum_query_form
(
alias
=
", diff(c1)"
))
# mix with calculation function 2
tdSql
.
error
(
self
.
csum_query_form
(
alias
=
", diff(c1)"
))
# mix with calculation function 2
# tdSql.error(self.csum_query_form(alias=" + 2")) # mix with arithmetic 1
# tdSql.error(self.csum_query_form(alias=" + 2")) # mix with arithmetic 1
tdSql
.
error
(
self
.
csum_query_form
(
alias
=
" + avg(c1)"
))
# mix with arithmetic 2
tdSql
.
error
(
self
.
csum_query_form
(
alias
=
" + avg(c1)"
))
# mix with arithmetic 2
tdSql
.
error
(
self
.
csum_query_form
(
alias
=
", c2"
))
# mix with other 1
#
tdSql.error(self.csum_query_form(alias=", c2")) # mix with other 1
# tdSql.error(self.csum_query_form(table_expr="stb1")) # select stb directly
# tdSql.error(self.csum_query_form(table_expr="stb1")) # select stb directly
stb_join
=
{
#
stb_join = {
"col"
:
"stb1.c1"
,
#
"col": "stb1.c1",
"table_expr"
:
"stb1, stb2"
,
#
"table_expr": "stb1, stb2",
"condition"
:
"where stb1.ts=stb2.ts and stb1.st1=stb2.st2 order by stb1.ts"
#
"condition": "where stb1.ts=stb2.ts and stb1.st1=stb2.st2 order by stb1.ts"
}
#
}
tdSql
.
error
(
self
.
csum_query_form
(
**
stb_join
))
# stb join
#
tdSql.error(self.csum_query_form(**stb_join)) # stb join
interval_sql
=
{
interval_sql
=
{
"condition"
:
"where ts>0 and ts < now interval(1h) fill(next)"
"condition"
:
"where ts>0 and ts < now interval(1h) fill(next)"
}
}
...
@@ -421,6 +421,19 @@ class TDTestCase:
...
@@ -421,6 +421,19 @@ class TDTestCase:
tdSql
.
query
(
"select csum(abs(c1))+2 from db.t1 "
)
tdSql
.
query
(
"select csum(abs(c1))+2 from db.t1 "
)
tdSql
.
checkRows
(
4
)
tdSql
.
checkRows
(
4
)
# support selectivity
tdSql
.
query
(
"select ts, c1, csum(1) from db.t1"
)
tdSql
.
checkRows
(
7
)
tdSql
.
query
(
"select csum(1), ts, c1 from db.t1"
)
tdSql
.
checkRows
(
7
)
tdSql
.
query
(
"select ts, c1, c2, c3, csum(1), ts, c4, c5, c6 from db.t1"
)
tdSql
.
checkRows
(
7
)
tdSql
.
query
(
"select ts, c1, csum(1), c4, c5, csum(1), c6 from db.t1"
)
tdSql
.
checkRows
(
7
)
def
csum_support_stable
(
self
):
def
csum_support_stable
(
self
):
tdSql
.
query
(
" select csum(1) from db.stb1 "
)
tdSql
.
query
(
" select csum(1) from db.stb1 "
)
tdSql
.
checkRows
(
70
)
tdSql
.
checkRows
(
70
)
...
@@ -474,6 +487,7 @@ class TDTestCase:
...
@@ -474,6 +487,7 @@ class TDTestCase:
# tdSql.checkRows(4)
# tdSql.checkRows(4)
def
run
(
self
):
def
run
(
self
):
import
traceback
import
traceback
try
:
try
:
...
...
tests/system-test/2-query/statecount.py
浏览文件 @
31abaa31
...
@@ -105,8 +105,6 @@ class TDTestCase:
...
@@ -105,8 +105,6 @@ class TDTestCase:
"select statecount(c1 ,'GT',1) , min(c1) from t1"
,
"select statecount(c1 ,'GT',1) , min(c1) from t1"
,
"select statecount(c1 ,'GT',1) , spread(c1) from t1"
,
"select statecount(c1 ,'GT',1) , spread(c1) from t1"
,
"select statecount(c1 ,'GT',1) , diff(c1) from t1"
,
"select statecount(c1 ,'GT',1) , diff(c1) from t1"
,
"select statecount(c1 ,'GT',1) , abs(c1) from t1"
,
"select statecount(c1 ,'GT',1) , c1 from t1"
,
]
]
for
error_sql
in
error_sql_lists
:
for
error_sql
in
error_sql_lists
:
tdSql
.
error
(
error_sql
)
tdSql
.
error
(
error_sql
)
...
@@ -227,17 +225,56 @@ class TDTestCase:
...
@@ -227,17 +225,56 @@ class TDTestCase:
tdSql
.
query
(
"select statecount(c6,'GT',1) from ct4"
)
tdSql
.
query
(
"select statecount(c6,'GT',1) from ct4"
)
tdSql
.
checkRows
(
12
)
tdSql
.
checkRows
(
12
)
tdSql
.
error
(
"select statecount(c6,'GT',1),tbname from ct1"
)
tdSql
.
query
(
"select statecount(c6,'GT',1),tbname from ct1"
)
tdSql
.
error
(
"select statecount(c6,'GT',1),t1 from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select statecount(c6,'GT',1),t1 from ct1"
)
tdSql
.
checkRows
(
13
)
# unique with common col
# unique with common col
tdSql
.
error
(
"select statecount(c6,'GT',1) ,ts from ct1"
)
tdSql
.
query
(
"select statecount(c6,'GT',1) ,ts from ct1"
)
tdSql
.
error
(
"select statecount(c6,'GT',1) ,c1 from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select ts, statecount(c6,'GT',1) from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select statecount(c6,'GT',1) ,c1 from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select c1, statecount(c6,'GT',1) from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select ts, c1, c2, c3, statecount(c6,'GT',1) from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select statecount(c6,'GT',1), ts, c1, c2, c3 from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select ts, c1, c2, c3, statecount(c6,'GT',1), ts, c4, c5, c6 from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select stateduration(c6,'GT',1) ,ts from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select ts, stateduration(c6,'GT',1) from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select stateduration(c6,'GT',1) ,c1 from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select c1, stateduration(c6,'GT',1) from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select ts, c1, c2, c3, stateduration(c6,'GT',1) from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select stateduration(c6,'GT',1), ts, c1, c2, c3 from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select ts, c1, c2, c3, stateduration(c6,'GT',1), ts, c4, c5, c6 from ct1"
)
tdSql
.
checkRows
(
13
)
# unique with scalar function
# unique with scalar function
tdSql
.
error
(
"select statecount(c6,'GT',1) ,abs(c1) from ct1"
)
tdSql
.
query
(
"select statecount(c6,'GT',1) , abs(c1) from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select statecount(c6,'GT',1) , abs(c2)+2 from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
error
(
"select statecount(c6,'GT',1) , unique(c2) from ct1"
)
tdSql
.
error
(
"select statecount(c6,'GT',1) , unique(c2) from ct1"
)
tdSql
.
error
(
"select statecount(c6,'GT',1) , abs(c2)+2 from ct1"
)
tdSql
.
query
(
"select stateduration(c6,'GT',1) , abs(c1) from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
query
(
"select stateduration(c6,'GT',1) , abs(c2)+2 from ct1"
)
tdSql
.
checkRows
(
13
)
tdSql
.
error
(
"select stateduration(c6,'GT',1) , unique(c2) from ct1"
)
# unique with aggregate function
# unique with aggregate function
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录