Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
08aca97d
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看板
未验证
提交
08aca97d
编写于
4月 20, 2022
作者:
M
Minglei Jin
提交者:
GitHub
4月 20, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #11667 from taosdata/xiaoping/cases
test(query): add test case for group by multiple columns
上级
e34332de
843cffa9
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
32 addition
and
0 deletion
+32
-0
tests/pytest/query/queryGroupbySort.py
tests/pytest/query/queryGroupbySort.py
+32
-0
未找到文件。
tests/pytest/query/queryGroupbySort.py
浏览文件 @
08aca97d
...
...
@@ -16,6 +16,7 @@ import taos
from
util.log
import
tdLog
from
util.cases
import
tdCases
from
util.sql
import
tdSql
import
random
class
TDTestCase
:
...
...
@@ -56,6 +57,37 @@ class TDTestCase:
tdSql
.
checkData
(
0
,
0
,
11.6
)
tdSql
.
query
(
"select avg(current) from meters group by t4;"
)
tdSql
.
query
(
"select avg(current) from meters group by t3,t4;"
)
# TS-899
tdSql
.
execute
(
"create table stb(ts timestamp, c0 int, c1 double, c2 binary(20), c3 int) tags(t1 int, t2 nchar(20))"
)
tags
=
[
"beijing"
,
"shanghai"
]
cols
=
[
"chaoyang"
,
"haidian"
,
"shunyi"
]
for
i
in
range
(
10
):
tdSql
.
execute
(
"create table t%d using stb tags(%d, '%s')"
%
(
i
,
i
,
tags
[
i
%
2
]))
sql
=
"insert into t%d values"
%
i
for
j
in
range
(
100
):
sql
+=
"(%d, %d, %f, '%s', %d)"
%
(
self
.
ts
+
j
,
j
%
10
+
1
,
random
.
uniform
(
1
,
10
),
cols
[
j
%
3
],
j
%
5
+
1
)
tdSql
.
execute
(
sql
)
tdSql
.
error
(
"select count(*) from stb group by c1"
)
tdSql
.
query
(
"select count(*), c0, c2, c3 from stb group by c0, c2, c3"
)
tdSql
.
checkRows
(
30
)
tdSql
.
query
(
"select count(*), c0, c2, c3 from stb group by c0, c2, c3, t1, t2"
)
tdSql
.
checkRows
(
300
)
tdSql
.
query
(
"select count(*), c0 from t0 group by c0"
)
tdSql
.
checkRows
(
10
)
tdSql
.
checkData
(
0
,
0
,
10
)
# corner cases
tdSql
.
execute
(
"create table tb(ts timestamp, c0 int, c1 bool, c2 float, c3 double)"
)
tdSql
.
error
(
"select count(*) from tb group by c2"
)
tdSql
.
error
(
"select count(*) from tb group by c3"
)
tdSql
.
error
(
"select count(*) from tb group by c2, c3"
)
tdSql
.
query
(
"select count(*) from tb group by c1"
)
tdSql
.
checkRows
(
0
)
def
stop
(
self
):
tdSql
.
close
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录