Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
5570e964
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看板
未验证
提交
5570e964
编写于
8月 11, 2022
作者:
G
Ganlin Zhao
提交者:
GitHub
8月 11, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15972 from taosdata/fix/TD-18115
test: add interp test cases
上级
a28c0781
72571731
变更
3
展开全部
隐藏空白更改
内联
并排
Showing
3 changed file
with
579 addition
and
16 deletion
+579
-16
tests/system-test/2-query/interp.py
tests/system-test/2-query/interp.py
+559
-0
tests/system-test/2-query/sample.py
tests/system-test/2-query/sample.py
+16
-16
tests/system-test/fulltest.sh
tests/system-test/fulltest.sh
+4
-0
未找到文件。
tests/system-test/2-query/interp.py
0 → 100644
浏览文件 @
5570e964
此差异已折叠。
点击以展开。
tests/system-test/2-query/sample.py
浏览文件 @
5570e964
...
...
@@ -335,7 +335,7 @@ class TDTestCase:
# case11 = {"alias": ", st1"}
# self.checksample(**case11)
tdSql
.
query
(
"select sample( c1 , 1 ) , st1 from t1"
)
# case12 = {"alias": ", c1"}
# self.checksample(**case12)
...
...
@@ -497,7 +497,7 @@ class TDTestCase:
# tdSql.query(" select sample(c1 , 1) + 2 from t1 ")
err41
=
{
"alias"
:
"+ avg(c1)"
}
# self.checksample(**err41) # mix with arithmetic 2
# err42 = {"alias": ", c1"}
# self.checksample(**err42)
tdSql
.
query
(
"select sample( c1 , 1 ) , c1 from t1"
)
...
...
@@ -605,14 +605,14 @@ class TDTestCase:
tdSql
.
execute
(
f
"create table tt
{
i
}
using stb2 tags(
{
i
}
)"
)
pass
def
check_sample
(
self
,
sample_query
,
origin_query
):
tdSql
.
query
(
origin_query
)
origin_datas
=
tdSql
.
queryResult
tdSql
.
query
(
sample_query
)
sample_datas
=
tdSql
.
queryResult
...
...
@@ -620,7 +620,7 @@ class TDTestCase:
for
ind
,
sample_data
in
enumerate
(
sample_datas
):
if
sample_data
not
in
origin_datas
:
status
=
False
if
status
:
tdLog
.
info
(
" sample data is in datas groups ,successed sql is : %s"
%
sample_query
)
else
:
...
...
@@ -637,7 +637,7 @@ class TDTestCase:
tags (t1 int)
'''
)
tdSql
.
execute
(
'''
create table t1
...
...
@@ -689,7 +689,7 @@ class TDTestCase:
tdSql
.
error
(
" select sample(c1,ts) from t1 "
)
tdSql
.
error
(
" select sample(c1,false) from t1 "
)
tdSql
.
query
(
" select sample(123,1) from t1 "
)
tdSql
.
query
(
" select sample(c1,2) from t1 "
)
tdSql
.
checkRows
(
2
)
tdSql
.
query
(
" select sample(c1,10) from t1 "
)
...
...
@@ -704,10 +704,10 @@ class TDTestCase:
tdSql
.
checkRows
(
9
)
tdSql
.
error
(
" select sample(c1,-1) from t1 "
)
# bug need fix
# bug need fix
# tdSql.query("select sample(c1 ,2) , 123 from stb1;")
# all type support
# all type support
tdSql
.
query
(
" select sample(c1 , 20 ) from ct4 "
)
tdSql
.
checkRows
(
9
)
...
...
@@ -761,7 +761,7 @@ class TDTestCase:
self
.
check_sample
(
"select sample( c1 ,3 ) from t1 where c1 between 1 and 10"
,
"select c1 from t1 where c1 between 1 and 10"
)
# join
# join
tdSql
.
query
(
"select sample( ct4.c1 , 1 ) from ct1, ct4 where ct4.ts=ct1.ts"
)
...
...
@@ -772,22 +772,22 @@ class TDTestCase:
self
.
check_sample
(
"select sample(c1,2) from stb1 partition by tbname"
,
"select c1 from stb1 partition by tbname"
)
# nest query
# nest query
# tdSql.query("select sample(c1,2) from (select c1 from t1); ")
# tdSql.checkRows(2)
# union all
# union all
tdSql
.
query
(
"select sample(c1,2) from t1 union all select sample(c1,3) from t1"
)
tdSql
.
checkRows
(
5
)
# fill interval
# not support mix with other function
# not support mix with other function
tdSql
.
error
(
"select top(c1,2) , sample(c1,2) from ct1"
)
tdSql
.
error
(
"select max(c1) , sample(c1,2) from ct1"
)
tdSql
.
query
(
"select c1 , sample(c1,2) from ct1"
)
# bug for mix with scalar
# bug for mix with scalar
tdSql
.
query
(
"select 123 , sample(c1,100) from ct1"
)
tdSql
.
query
(
"select sample(c1,100)+2 from ct1"
)
tdSql
.
query
(
"select abs(sample(c1,100)) from ct1"
)
...
...
@@ -864,13 +864,13 @@ class TDTestCase:
for
i
in
range
(
2000
):
ts
=
self
.
ts
+
i
*
10
tdSql
.
execute
(
f
"insert into sub_tb values(
{
ts
}
,
{
i
}
)"
)
tdSql
.
query
(
"select count(*) from st"
)
tdSql
.
checkData
(
0
,
0
,
2000
)
tdSql
.
query
(
"select sample(c1 ,1000) from st"
)
tdSql
.
checkRows
(
1000
)
# bug need fix
# bug need fix
tdSql
.
query
(
"select c1 ,t1, sample(c1,2) from db.stb1 partition by c1 "
)
tdSql
.
query
(
"select sample(c1,2) from db.stb1 partition by c1 "
)
# tdSql.query("select c1 ,ind, sample(c1,2) from sample_db.st partition by c1 ")
...
...
tests/system-test/fulltest.sh
浏览文件 @
5570e964
...
...
@@ -96,6 +96,8 @@ python3 ./test.py -f 2-query/distribute_agg_stddev.py
python3 ./test.py
-f
2-query/distribute_agg_stddev.py
-R
python3 ./test.py
-f
2-query/distribute_agg_sum.py
python3 ./test.py
-f
2-query/distribute_agg_sum.py
-R
python3 ./test.py
-f
2-query/interp.py
python3 ./test.py
-f
2-query/interp.py
-R
...
...
@@ -338,6 +340,7 @@ python3 ./test.py -f 2-query/arcsin.py -Q 2
python3 ./test.py
-f
2-query/arccos.py
-Q
2
python3 ./test.py
-f
2-query/arctan.py
-Q
2
python3 ./test.py
-f
2-query/query_cols_tags_and_or.py
-Q
2
python3 ./test.py
-f
2-query/interp.py
-Q
2
# python3 ./test.py -f 2-query/nestedQuery.py -Q 2
# python3 ./test.py -f 2-query/nestedQuery_str.py -Q 2
...
...
@@ -457,3 +460,4 @@ python3 ./test.py -f 2-query/max_partition.py -Q 3
python3 ./test.py
-f
2-query/last_row.py
-Q
3
python3 ./test.py
-f
2-query/tsbsQuery.py
-Q
3
python3 ./test.py
-f
2-query/sml.py
-Q
3
python3 ./test.py
-f
2-query/interp.py
-Q
3
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录