Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dc7e3006
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1192
Star
22018
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看板
提交
dc7e3006
编写于
1月 21, 2022
作者:
G
Ganlin Zhao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[TD-11222]<feature>: Histogram function
上级
22dbc4c6
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
449 addition
and
0 deletion
+449
-0
tests/develop-test/2-query/function_histogram.py
tests/develop-test/2-query/function_histogram.py
+449
-0
未找到文件。
tests/develop-test/2-query/function_histogram.py
浏览文件 @
dc7e3006
...
@@ -1949,8 +1949,457 @@ class TDTestCase:
...
@@ -1949,8 +1949,457 @@ class TDTestCase:
tdSql
.
error
(
'select histogram(col_double,
\'
log_bin
\'
,
\'
{"start": -0.5, "factor": 0.5, "count": 2, "infinity": true}
\'
, abc) from tb;'
)
tdSql
.
error
(
'select histogram(col_double,
\'
log_bin
\'
,
\'
{"start": -0.5, "factor": 0.5, "count": 2, "infinity": true}
\'
, abc) from tb;'
)
## Combinations ##
## Combinations ##
#select distinct func(col_name)
tdSql
.
error
(
'select distinct histogram(col_tinyint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(col_smallint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(col_int, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(col_bigint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(col_float, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(col_double, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(col_bool, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(col_timestamp, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(col_nchar, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(col_binary, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(tag_tinyint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(tag_smallint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(tag_int, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(tag_bigint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(tag_float, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(tag_double, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(tag_bool, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(tag_timestamp, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(tag_nchar, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select distinct histogram(tag_binary, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(*, "user_input", "[1,3,5,7]", 0) from stb;'
)
#select func(col_name arith_oper xxx)
tdSql
.
error
(
'select histogram(col_int + 1, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int - 1, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int * 2.0, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int / 2.0, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int % 2.0, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_timestamp + now, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int + col_bigint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int - col_bigint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int * col_bigint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int / col_bigint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int % col_bigint, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int + pow(1,2), "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int - abs(-100), "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int * round(col_float), "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int / ceil(1.5), "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int % floor(col_double), "user_input", "[1,3,5,7]", 0) from stb;'
)
#select func() arith_oper xxx
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) + 1 from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) - 1 from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) * 1 from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) / 1 from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) % 1 from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) + col_double from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) - col_double from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) * col_double from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) / col_double from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) % col_double from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) + abs(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) - ceil(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) * floor(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) / round(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) % acos(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) + max(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) - min(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) * first(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) / last(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) % top(col_double, 1) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) + sum(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) - avg(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) * count(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) / stddev(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0) % twa(col_double) from stb;'
)
#select func(),xxx
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),col_tinyint from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),col_smallint from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),col_int from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),col_bigint from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),col_timstamp from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),col_bool from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),col_float from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),col_double from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),col_binary from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),col_nchar from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_tinyint from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_smallint from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_int from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_bigint from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_timstamp from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_bool from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_float from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_double from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_binary from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_nchar from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_tinyint from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_smallint from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_int from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_bigint from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_timstamp from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_bool from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_float from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_double from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_binary from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tag_nchar from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),ts from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),tbname from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),_c0 from stb;'
)
tdSql
.
error
(
'select histogram(tag_int, "user_input", "[1,3,5,7]", 0),_C0 from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),abs(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),ceil(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),floor(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),round(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),acos(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),max(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),min(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),first(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),last(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),top(col_double, 1) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),sum(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),avg(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),count(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),stddev(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),twa(col_double) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),histogram(col_int, "user_input", "[1,3,5,7]", 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),histogram(col_int, "linear_bin",
\'
{"start": -1, "width":5, "count":5, "infinity":false}
\'
, 0) from stb;'
)
tdSql
.
error
(
'select histogram(col_int, "user_input", "[1,3,5,7]", 0),histogram(col_int, "log_bin",
\'
{"start": 10, "factor":0.5, "count":5, "infinity":false}
\'
, 0) from stb;'
)
#select where condition
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb where col_int > 3;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb where col_int < 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb where col_int >= 3;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:1"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb where col_int <= 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb where col_int = 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:0"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb where col_int != 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb where col_int <> 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb where col_int > 5 and col_int <7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:0"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb where col_int >= 5 and col_int <=7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:1"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_int, "user_input", "[1,3,5,7,9,15]", 0) from tb where col_int between 5 and 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:1"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb where col_tinyint > 3;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb where col_tinyint < 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb where col_tinyint >= 3;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:1"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb where col_tinyint <= 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb where col_tinyint = 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:0"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb where col_tinyint != 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb where col_tinyint <> 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb where col_tinyint > 5 and col_tinyint <7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:0"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb where col_tinyint >= 5 and col_tinyint <=7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:1"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_tinyint, "user_input", "[1,3,5,7,9,15]", 0) from ctb where col_tinyint between 5 and 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:1"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where col_bigint > 3;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where col_bigint < 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where col_bigint >= 3;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:1"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where col_bigint <= 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where col_bigint = 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:0"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where col_bigint != 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where col_bigint <> 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where col_bigint > 5 and col_bigint <7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:0"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:1"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where col_bigint >= 5 and col_bigint <=7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:1"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where col_bigint between 5 and 7;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:0"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:1"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:0"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:0"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where tag_bigint > 0;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where tag_bigint < 2;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where tag_bigint >= 1;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where tag_bigint <= 1;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where tag_bigint = 1;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where tag_bigint != 2;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where tag_bigint <> 2;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where tag_bigint > 0 and tag_bigint < 2;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where tag_bigint >= 1 and tag_bigint <= 1;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
tdSql
.
query
(
'select histogram(col_bigint, "user_input", "[1,3,5,7,9,15]", 0) from stb where tag_bigint between 0 and 2;'
)
tdSql
.
checkRows
(
5
)
tdSql
.
checkData
(
0
,
0
,
"(1:3]:2"
);
tdSql
.
checkData
(
1
,
0
,
"(3:5]:2"
);
tdSql
.
checkData
(
2
,
0
,
"(5:7]:2"
);
tdSql
.
checkData
(
3
,
0
,
"(7:9]:2"
);
tdSql
.
checkData
(
4
,
0
,
"(9:15]:2"
);
#select session
#select state_window
#select interval/sliding/fill
return
tdSql
.
execute
(
'drop database db'
)
tdSql
.
execute
(
'drop database db'
)
def
stop
(
self
):
def
stop
(
self
):
tdSql
.
close
()
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录