Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8175b36d
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看板
提交
8175b36d
编写于
2月 22, 2023
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add test cases
上级
39d38c15
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
37 addition
and
9 deletion
+37
-9
tests/system-test/2-query/percentile.py
tests/system-test/2-query/percentile.py
+37
-9
未找到文件。
tests/system-test/2-query/percentile.py
浏览文件 @
8175b36d
...
...
@@ -117,6 +117,20 @@ class TDTestCase:
else
:
tdSql
.
query
(
f
'select percentile(
{
k
}
,
{
param
}
) from
{
self
.
ntbname
}
'
)
tdSql
.
checkData
(
0
,
0
,
np
.
percentile
(
floatData
,
param
))
tdSql
.
query
(
f
'select percentile(col1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100) from
{
self
.
ntbname
}
'
)
tdSql
.
checkData
(
0
,
0
,
'[0.900000, 1.800000, 2.700000, 3.600000, 4.500000, 5.400000, 6.300000, 7.200000, 8.100000, 9.000000]'
)
tdSql
.
query
(
f
'select percentile(col1, 9.9, 19.9, 29.9, 39.9, 49.9, 59.9, 69.9, 79.9, 89.9, 99.9) from
{
self
.
ntbname
}
'
)
tdSql
.
checkData
(
0
,
0
,
'[0.891000, 1.791000, 2.691000, 3.591000, 4.491000, 5.391000, 6.291000, 7.191000, 8.091000, 8.991000]'
)
tdSql
.
error
(
f
'select percentile(col1) from
{
self
.
ntbname
}
'
)
tdSql
.
error
(
f
'select percentile(col1, -1) from
{
self
.
ntbname
}
'
)
tdSql
.
error
(
f
'select percentile(col1, 101) from
{
self
.
ntbname
}
'
)
tdSql
.
error
(
f
'select percentile(col1, col2) from
{
self
.
ntbname
}
'
)
tdSql
.
error
(
f
'select percentile(1, col1) from
{
self
.
ntbname
}
'
)
tdSql
.
error
(
f
'select percentile(col1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101) from
{
self
.
ntbname
}
'
)
tdSql
.
execute
(
f
'drop database
{
self
.
dbname
}
'
)
def
function_check_ctb
(
self
):
tdSql
.
execute
(
f
'create database
{
self
.
dbname
}
'
)
...
...
@@ -145,6 +159,20 @@ class TDTestCase:
data_num
=
tdSql
.
queryResult
[
0
][
0
]
tdSql
.
query
(
f
'select percentile(
{
k
}
,
{
param
}
) from
{
self
.
stbname
}
_
{
i
}
'
)
tdSql
.
checkData
(
0
,
0
,
data_num
)
tdSql
.
query
(
f
'select percentile(col1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100) from
{
self
.
stbname
}
_0'
)
tdSql
.
checkData
(
0
,
0
,
'[0.900000, 1.800000, 2.700000, 3.600000, 4.500000, 5.400000, 6.300000, 7.200000, 8.100000, 9.000000]'
)
tdSql
.
query
(
f
'select percentile(col1, 9.9, 19.9, 29.9, 39.9, 49.9, 59.9, 69.9, 79.9, 89.9, 99.9) from
{
self
.
stbname
}
_0'
)
tdSql
.
checkData
(
0
,
0
,
'[0.891000, 1.791000, 2.691000, 3.591000, 4.491000, 5.391000, 6.291000, 7.191000, 8.091000, 8.991000]'
)
tdSql
.
error
(
f
'select percentile(col1) from
{
self
.
stbname
}
_0'
)
tdSql
.
error
(
f
'select percentile(col1, -1) from
{
self
.
stbname
}
_0'
)
tdSql
.
error
(
f
'select percentile(col1, 101) from
{
self
.
stbname
}
_0'
)
tdSql
.
error
(
f
'select percentile(col1, col2) from
{
self
.
stbname
}
_0'
)
tdSql
.
error
(
f
'select percentile(1, col1) from
{
self
.
stbname
}
_0'
)
tdSql
.
error
(
f
'select percentile(col1, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 101) from
{
self
.
stbname
}
_0'
)
tdSql
.
execute
(
f
'drop database
{
self
.
dbname
}
'
)
def
run
(
self
):
self
.
function_check_ntb
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录