Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
4ab17055
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看板
未验证
提交
4ab17055
编写于
12月 14, 2021
作者:
H
Hui Li
提交者:
GitHub
12月 14, 2021
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #8934 from taosdata/interp_case_develop
[TD-10739]<test>: add test case for interp
上级
b96330dc
7d3823eb
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
39 addition
and
0 deletion
+39
-0
tests/pytest/functions/function_interp.py
tests/pytest/functions/function_interp.py
+39
-0
未找到文件。
tests/pytest/functions/function_interp.py
浏览文件 @
4ab17055
...
@@ -8360,6 +8360,45 @@ class TDTestCase:
...
@@ -8360,6 +8360,45 @@ class TDTestCase:
sql += "where ts >= '%s' AND ts <= '%s' range('%s' , '%s') EVERY(1s) FILL(NULL);" % (self.ts , self.ts + 10000 , self.ts + 150000 , self.ts + 200000)
sql += "where ts >= '%s' AND ts <= '%s' range('%s' , '%s') EVERY(1s) FILL(NULL);" % (self.ts , self.ts + 10000 , self.ts + 150000 , self.ts + 200000)
datacheck = tdSql.error(sql)
datacheck = tdSql.error(sql)
# TD-10736 Exception use case for coredump
tdSql.execute("create database db_except;")
tdSql.execute("use db_except;")
tdSql.execute("create table tb (ts timestamp, c1 int);")
tdSql.execute("insert into tb values ('2021-10-01 08:00:00.000' ,1);")
tdSql.execute("insert into tb values ('2021-10-01 08:00:01.000' ,2);")
tdSql.execute("insert into tb values ('2021-10-01 08:00:02.000' ,3);")
tdSql.execute("insert into tb values ('2021-10-01 08:00:03.000' ,4);")
tdSql.execute("create stable stb (ts timestamp, c1 int) tags (id int);")
tdSql.execute("insert into sub_1 using stb tags (1) values ('2021-10-01 08:00:00.000' ,1);")
tdSql.execute("insert into sub_1 using stb tags (1) values ('2021-10-01 08:00:01.000' ,2);")
tdSql.execute("insert into sub_2 using stb tags (1) values ('2021-10-01 08:00:00.000' ,3);")
tdSql.execute("insert into sub_2 using stb tags (1) values ('2021-10-01 08:00:01.000' ,4);")
tdSql.execute("insert into sub_3 using stb tags (1) values ('2021-10-01 08:00:01.000' ,1);")
tdSql.execute("insert into sub_3 using stb tags (1) values ('2021-10-01 08:00:02.000' ,2);")
tdSql.execute("insert into sub_3 using stb tags (1) values ('2021-10-01 08:00:03.000' ,3);")
tdSql.execute("insert into sub_3 using stb tags (1) values ('2021-10-01 08:00:04.000' ,4);")
tdSql.query("select interp(c1) from tb where ts = '2021-10-01 08:00:00.000' every(1s); ")
tdSql.checkData(0,1,1)
tdSql.query("select interp(c1) from tb where ts = '2021-10-01 08:00:98.000' every(1s); ")
tdSql.checkRows(0)
tdSql.query("select interp(c1) from sub_1 where ts = '2021-10-01 08:00:00.000' every(1s); ")
tdSql.checkData(0,1,1)
tdSql.query("select interp(c1) from sub_1 where ts = '2021-10-01 08:00:98.000' every(1s); ")
tdSql.checkRows(0)
tdSql.error("select interp(c1) from stb where ts = '2021-10-01 08:00:00.000' every(1s); ")
tdSql.error("select interp(c1) from stb where ts = '2021-10-01 08:00:98.000' every(1s); ")
tdSql.query("select interp(c1) from stb where ts = '2021-10-01 08:00:00.000' every(1s) group by tbname; ")
tdSql.checkRows(2)
tdSql.query("select interp(c1) from stb where ts = '2021-10-01 08:00:98.000' every(1s) group by tbname; ")
tdSql.checkRows(0)
# Nested Query + where + range + FILL(NULL) + EVERY( s)(3)
# Nested Query + where + range + FILL(NULL) + EVERY( s)(3)
# sql = "select * from (select %s from stable_1 where ts BETWEEN '%s' AND '%s' range('%s' , '%s') EVERY(1s) FILL(NULL) group by tbname) z1," % (interp_select , self.ts , self.ts + 10000 , self.ts - 10000 , self.ts + 100000)
# sql = "select * from (select %s from stable_1 where ts BETWEEN '%s' AND '%s' range('%s' , '%s') EVERY(1s) FILL(NULL) group by tbname) z1," % (interp_select , self.ts , self.ts + 10000 , self.ts - 10000 , self.ts + 100000)
# sql += "(select %s from stable_2 where ts BETWEEN '%s' AND '%s' range('%s' , '%s') EVERY(1s) FILL(NULL) group by tbname) z2 where z1.ts=z2.ts ;" % (interp_select , self.ts , self.ts + 10000 , self.ts - 10000 , self.ts + 100000)
# sql += "(select %s from stable_2 where ts BETWEEN '%s' AND '%s' range('%s' , '%s') EVERY(1s) FILL(NULL) group by tbname) z2 where z1.ts=z2.ts ;" % (interp_select , self.ts , self.ts + 10000 , self.ts - 10000 , self.ts + 100000)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录