未验证 提交 a0a41528 编写于 作者: H Hui Li 提交者: GitHub

Merge pull request #8879 from taosdata/test/TD-11074-d

[11074]<test>Add some group by test scenarios
...@@ -132,6 +132,25 @@ class TDTestCase: ...@@ -132,6 +132,25 @@ class TDTestCase:
tdSql.error("select top(tbcol1, 12) from st order by ts, tbcol1") tdSql.error("select top(tbcol1, 12) from st order by ts, tbcol1")
tdSql.error("select top(tbcol1, 2) from st1 group by tbcol1 order by tbcol2") tdSql.error("select top(tbcol1, 2) from st1 group by tbcol1 order by tbcol2")
fun_list = ['avg','count','twa','sum','stddev','leastsquares','min',
'max','first','last','top','bottom','percentile','apercentile',
'last_row','diff','spread','distinct']
key = ['tbol','tagcol']
for i in range(1,15):
for k in key:
for j in fun_list:
if j == 'leastsquares':
pick_func=j+'('+ k + str(i) +',1,1)'
elif j == 'top' or j == 'bottom' : continue
elif j == 'percentile' or j == 'apercentile':
pick_func=j+'('+ k + str(i) +',1)'
else:
pick_func=j+'('+ k + str(i) +')'
sql = 'select %s from st group by %s order by %s' % (pick_func , k+str(i), k+str(i))
tdSql.error(sql)
sql = 'select %s from st6 group by %s order by %s ' % (pick_func , k+str(i), k+str(i))
tdSql.error(sql)
tdSql.query("select top(tbcol1, 2) from st1 group by tbcol2 order by tbcol2") tdSql.query("select top(tbcol1, 2) from st1 group by tbcol2 order by tbcol2")
tdSql.query("select top(tbcol1, 12) from st order by tbcol1, ts") tdSql.query("select top(tbcol1, 12) from st order by tbcol1, ts")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册