Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
c5d95abb
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看板
提交
c5d95abb
编写于
10月 27, 2022
作者:
haoranc
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
teat: supplement muti-branch for testcase histogram.py
上级
19849b8b
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
60 addition
and
2 deletion
+60
-2
tests/system-test/2-query/histogram.py
tests/system-test/2-query/histogram.py
+60
-2
未找到文件。
tests/system-test/2-query/histogram.py
浏览文件 @
c5d95abb
...
...
@@ -48,10 +48,12 @@ DBNAME = "db"
STBNAME
=
"stb1"
CTBNAME
=
"ct1"
NTBNAME
=
"nt1"
PARAINF
=
float
(
"inf"
)
@
dataclass
class
Hsgschema
:
func_type
:
str
=
"SELECT"
from_clause
:
str
=
f
"
{
STBNAME
}
"
where_clause
:
str
=
None
...
...
@@ -269,7 +271,7 @@ class TDTestCase:
else
:
tdLog
.
success
(
f
"summary of result count is
{
sum_rate
}
!"
)
else
:
def
hsg_check_error
(
self
,
sma
:
Hsgschema
,
dbname
=
DBNAME
)
:
tdSql
.
error
(
self
.
__gen_sql
(
sma
,
dbname
))
@
property
...
...
@@ -319,6 +321,7 @@ class TDTestCase:
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": 1, "width": 1, "count": -10, "infinity": false}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": 1, "width": 1, "count": 10, "infinity": "false"}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": 1, "width": 1, "count": 10, "infinity": null}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
[
'{"start": 1, "factor": 4, "count": 4, "infinity": true}'
],
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'[{"start": 1, "factor": 4, "count": 4, "infinity": true}]'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'{"begin": 1, "factor": 4, "count": 4, "infinity": true}'
,
normalized
=
1
)
)
...
...
@@ -347,6 +350,51 @@ class TDTestCase:
err_sqls
.
append
(
Hsgschema
(
col
=
BOOL_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'{"start": 1, "factor": 10, "count": 10, "infinity": false}'
)
)
# add testcase by chr
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"USER_INPUT"
,
user_input
=
"[]"
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"USER_INPUT"
,
user_input
=
"[1,'listStr',2]"
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": %f, "width": 10000000, "count": 10000000, "infinity": false}'
%
PARAINF
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": 2000, "width": %f, "count": 10, "infinity": false}'
%
PARAINF
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": 10, "width": 10, "count": %f, "infinity": false}'
%
PARAINF
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'{"start": 1, "factor": %f, "count": 10, "infinity": false}'
%
PARAINF
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": %f, "width": %f, "count": %f, "infinity": false}'
%
(
PARAINF
,
PARAINF
,
PARAINF
),
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": 10, "width": 10, "count": 0, "infinity": false}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": 10, "width": 10, "count": -10, "infinity": false}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": 10, "width": 10, "count": 1001, "infinity": false}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"linear_bin"
,
linear_bin
=
'{"start": 10, "width": 10, "count": 1001, "infinity": false , "linerBinNumber":5}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'{"start": 1, "factor":-100, "count": 10, "infinity": false}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'{"start": 1, "factor":0, "count": 10, "infinity": false}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'{"start": 1, "factor":1, "count": 10, "infinity": false}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'{"start": %f, "factor":10, "count": 10, "infinity": false}'
%
PARAINF
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'{"start": 1, "factor":10, "count": %f, "infinity": false}'
%
PARAINF
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'{"start": 1, "factor":10, "count": %f, "infinity": false}'
%
PARAINF
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
INT_COL
,
bin_type
=
"log_bin"
,
log_bin
=
'{"start": 1, "factor":10, "count": %f, "infinity": false, "logBinNumber":5}'
,
normalized
=
1
)
)
err_sqls
.
append
(
Hsgschema
(
col
=
{
"errorColType"
:
INT_COL
},
bin_type
=
"USER_INPUT"
,
user_input
=
"[0,3,6,9]"
,
normalized
=
1
)
)
# err_sqls.append( Hsgschema(col=INT_COL, bin_type=, user_input="[0,3,6,9]", normalized=1) )
# err_sqls.append( Hsgschema(col=INT_COL, bin_type="USER_INPUT", user_input="[0,3,6,9]", normalized=1) )
# err_sqls.append( Hsgschema(col=INT_COL, bin_type="USER_INPUT", user_input="[0,3,6,9]", normalized=1) )
### case 2:
# current_set
...
...
@@ -386,7 +434,7 @@ class TDTestCase:
def
test_histogram
(
self
,
dbname
=
DBNAME
,
ctb_num
:
int
=
20
):
err_sqls
,
cur_sqls
=
self
.
__hsg_querysql
for
err_sql
in
err_sqls
:
self
.
hsg_check
(
err_sql
,
dbname
)
self
.
hsg_check
_error
(
err_sql
,
dbname
)
for
cur_sql
in
cur_sqls
:
self
.
hsg_check
(
cur_sql
,
dbname
)
...
...
@@ -405,6 +453,16 @@ class TDTestCase:
tdSql
.
checkData
(
1
,
0
,
'{"lower_bin":3, "upper_bin":6, "count":3}'
)
tdSql
.
checkData
(
2
,
0
,
'{"lower_bin":6, "upper_bin":9, "count":3}'
)
# if (4 != numOfParams)
# tdSql.error("select HISTOGRAM(c_int, \"linear_bin\", \"{\"start\": -200, \"width\": 100, \"count\": 20, \"infinity\": false}\", 1 , InvalidNumber) from db.nt1 where c_int < 10")
tdSql
.
error
(
'SELECT HISTOGRAM(c_int, "linear_bin", "{"start": -200, "width": 100, "count": 20, "infinity": false}", 0 ,InvalidNumber ) from %s.nt1 '
%
dbname
)
tdSql
.
error
(
'SELECT HISTOGRAM(c_int, "linear_bin", "{"start": -200, "width": 100, "count": 20, "infinity": false}" ) from %s.nt1 '
%
dbname
)
tdSql
.
error
(
'SELECT HISTOGRAM(c_int, 54321, "[0,3,6,9]", 1 ) from %s.nt1 '
%
dbname
)
tdSql
.
error
(
'SELECT HISTOGRAM(c_int, "USER_INPUT", 54321, 0 ) from %s.nt1'
%
dbname
)
tdSql
.
error
(
'SELECT HISTOGRAM(c_int, "USER_INPUT", "[0,3,6,9]", InvalidNumber ) from %s.nt1'
%
dbname
)
tdSql
.
error
(
'SELECT HISTOGRAM(c_int, "USER_INPUT", "[0,3,6,9]", -100 ) from %s.nt1'
%
dbname
)
def
all_test
(
self
,
dbname
=
DBNAME
):
self
.
test_histogram
(
dbname
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录