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

Merge pull request #17660 from taosdata/test/TD-19852

Test/td 19852
...@@ -298,14 +298,14 @@ class TDTestCase: ...@@ -298,14 +298,14 @@ class TDTestCase:
self.explain_check() self.explain_check()
# tdSql.query(f"explain verbose true select {INT_COL} from {dbname}.ct1") tdSql.query(f"explain verbose true select {INT_COL} from {dbname}.ct1")
# tdSql.query(f"explain verbose true select 1 from {dbname}.ct2") tdSql.query(f"explain verbose true select 1 from {dbname}.ct2")
# tdSql.query(f"explain verbose true select cast(ceil({DOUBLE_COL}) as bigint) from {dbname}.ct4 group by {DOUBLE_COL}") tdSql.query(f"explain verbose true select cast(ceil({DOUBLE_COL}) as bigint) from {dbname}.ct4 group by {DOUBLE_COL}")
# tdSql.query(f"explain verbose true select count({SINT_COL}) from {dbname}.ct4 group by {BOOL_COL} having count({SINT_COL}) > 0") tdSql.query(f"explain verbose true select count({SINT_COL}) from {dbname}.ct4 group by {BOOL_COL} having count({SINT_COL}) > 0")
# tdSql.query(f"explain verbose true select ct2.{SINT_COL} from {dbname}.ct4 ct4 join {dbname}.ct2 ct2 on ct4.ts=ct2.ts") tdSql.query(f"explain verbose true select ct2.{SINT_COL} from {dbname}.ct4 ct4 join {dbname}.ct2 ct2 on ct4.ts=ct2.ts")
# tdSql.query(f"explain verbose true select {INT_COL} from {dbname}.stb1 where {INT_COL} is not null and {INT_COL} in (0, 1, 2) or {INT_COL} between 2 and 100 ") tdSql.query(f"explain verbose true select {INT_COL} from {dbname}.stb1 where {INT_COL} is not null and {INT_COL} in (0, 1, 2) or {INT_COL} between 2 and 100 ")
# self.explain_check() self.explain_check()
tdSql.query(f"explain verbose false select {INT_COL} from {dbname}.ct1") tdSql.query(f"explain verbose false select {INT_COL} from {dbname}.ct1")
tdSql.query(f"explain verbose false select 1 from {dbname}.ct2") tdSql.query(f"explain verbose false select 1 from {dbname}.ct2")
...@@ -326,14 +326,14 @@ class TDTestCase: ...@@ -326,14 +326,14 @@ class TDTestCase:
self.explain_check() self.explain_check()
# tdSql.query(f"explain ratio {ratio} verbose true select {INT_COL} from {dbname}.ct1") tdSql.query(f"explain ratio {ratio} verbose true select {INT_COL} from {dbname}.ct1")
# tdSql.query(f"explain ratio {ratio} verbose true select 1 from {dbname}.ct2") tdSql.query(f"explain ratio {ratio} verbose true select 1 from {dbname}.ct2")
# tdSql.query(f"explain ratio {ratio} verbose true select cast(ceil({DOUBLE_COL}) as bigint) from {dbname}.ct4 group by {DOUBLE_COL}") tdSql.query(f"explain ratio {ratio} verbose true select cast(ceil({DOUBLE_COL}) as bigint) from {dbname}.ct4 group by {DOUBLE_COL}")
# tdSql.query(f"explain ratio {ratio} verbose true select count({SINT_COL}) from {dbname}.ct4 group by {BOOL_COL} having count({SINT_COL}) > 0") tdSql.query(f"explain ratio {ratio} verbose true select count({SINT_COL}) from {dbname}.ct4 group by {BOOL_COL} having count({SINT_COL}) > 0")
# tdSql.query(f"explain ratio {ratio} verbose true select ct2.{SINT_COL} from {dbname}.ct4 ct4 join {dbname}.ct2 ct2 on ct4.ts=ct2.ts") tdSql.query(f"explain ratio {ratio} verbose true select ct2.{SINT_COL} from {dbname}.ct4 ct4 join {dbname}.ct2 ct2 on ct4.ts=ct2.ts")
# tdSql.query(f"explain ratio {ratio} verbose true select {INT_COL} from {dbname}.stb1 where {INT_COL} is not null and {INT_COL} in (0, 1, 2) or {INT_COL} between 2 and 100 ") tdSql.query(f"explain ratio {ratio} verbose true select {INT_COL} from {dbname}.stb1 where {INT_COL} is not null and {INT_COL} in (0, 1, 2) or {INT_COL} between 2 and 100 ")
# self.explain_check() self.explain_check()
tdSql.query(f"explain ratio {ratio} verbose false select {INT_COL} from {dbname}.ct1") tdSql.query(f"explain ratio {ratio} verbose false select {INT_COL} from {dbname}.ct1")
tdSql.query(f"explain ratio {ratio} verbose false select 1 from {dbname}.ct2") tdSql.query(f"explain ratio {ratio} verbose false select 1 from {dbname}.ct2")
...@@ -353,14 +353,14 @@ class TDTestCase: ...@@ -353,14 +353,14 @@ class TDTestCase:
self.explain_check() self.explain_check()
# tdSql.query(f"explain analyze verbose true select {INT_COL} from {dbname}.ct1") tdSql.query(f"explain analyze verbose true select {INT_COL} from {dbname}.ct1")
# tdSql.query(f"explain analyze verbose true select 1 from {dbname}.ct2") tdSql.query(f"explain analyze verbose true select 1 from {dbname}.ct2")
# tdSql.query(f"explain analyze verbose true select cast(ceil({DOUBLE_COL}) as bigint) from {dbname}.ct4 group by {DOUBLE_COL}") tdSql.query(f"explain analyze verbose true select cast(ceil({DOUBLE_COL}) as bigint) from {dbname}.ct4 group by {DOUBLE_COL}")
# tdSql.query(f"explain analyze verbose true select count({SINT_COL}) from {dbname}.ct4 group by {BOOL_COL} having count({SINT_COL}) > 0") tdSql.query(f"explain analyze verbose true select count({SINT_COL}) from {dbname}.ct4 group by {BOOL_COL} having count({SINT_COL}) > 0")
# tdSql.query(f"explain analyze verbose true select ct2.{SINT_COL} from {dbname}.ct4 ct4 join {dbname}.ct2 ct2 on ct4.ts=ct2.ts") tdSql.query(f"explain analyze verbose true select ct2.{SINT_COL} from {dbname}.ct4 ct4 join {dbname}.ct2 ct2 on ct4.ts=ct2.ts")
# tdSql.query(f"explain analyze verbose true select {INT_COL} from {dbname}.stb1 where {INT_COL} is not null and {INT_COL} in (0, 1, 2) or {INT_COL} between 2 and 100 ") tdSql.query(f"explain analyze verbose true select {INT_COL} from {dbname}.stb1 where {INT_COL} is not null and {INT_COL} in (0, 1, 2) or {INT_COL} between 2 and 100 ")
# self.explain_check() self.explain_check()
tdSql.query(f"explain analyze verbose false select {INT_COL} from {dbname}.ct1") tdSql.query(f"explain analyze verbose false select {INT_COL} from {dbname}.ct1")
tdSql.query(f"explain analyze verbose false select 1 from {dbname}.ct2") tdSql.query(f"explain analyze verbose false select 1 from {dbname}.ct2")
...@@ -381,14 +381,14 @@ class TDTestCase: ...@@ -381,14 +381,14 @@ class TDTestCase:
self.explain_check() self.explain_check()
# tdSql.query(f"explain analyze ratio {ratio} verbose true select {INT_COL} from {dbname}.ct1") tdSql.query(f"explain analyze ratio {ratio} verbose true select {INT_COL} from {dbname}.ct1")
# tdSql.query(f"explain analyze ratio {ratio} verbose true select 1 from {dbname}.ct2") tdSql.query(f"explain analyze ratio {ratio} verbose true select 1 from {dbname}.ct2")
# tdSql.query(f"explain analyze ratio {ratio} verbose true select cast(ceil({DOUBLE_COL}) as bigint) from {dbname}.ct4 group by {DOUBLE_COL}") tdSql.query(f"explain analyze ratio {ratio} verbose true select cast(ceil({DOUBLE_COL}) as bigint) from {dbname}.ct4 group by {DOUBLE_COL}")
# tdSql.query(f"explain analyze ratio {ratio} verbose true select count({SINT_COL}) from {dbname}.ct4 group by {BOOL_COL} having count({SINT_COL}) > 0") tdSql.query(f"explain analyze ratio {ratio} verbose true select count({SINT_COL}) from {dbname}.ct4 group by {BOOL_COL} having count({SINT_COL}) > 0")
# tdSql.query(f"explain analyze ratio {ratio} verbose true select ct2.{SINT_COL} from {dbname}.ct4 ct4 join {dbname}.ct2 ct2 on ct4.ts=ct2.ts") tdSql.query(f"explain analyze ratio {ratio} verbose true select ct2.{SINT_COL} from {dbname}.ct4 ct4 join {dbname}.ct2 ct2 on ct4.ts=ct2.ts")
# tdSql.query(f"explain analyze ratio {ratio} verbose true select {INT_COL} from {dbname}.stb1 where {INT_COL} is not null and {INT_COL} in (0, 1, 2) or {INT_COL} between 2 and 100 ") tdSql.query(f"explain analyze ratio {ratio} verbose true select {INT_COL} from {dbname}.stb1 where {INT_COL} is not null and {INT_COL} in (0, 1, 2) or {INT_COL} between 2 and 100 ")
# self.explain_check() self.explain_check()
tdSql.query(f"explain analyze ratio {ratio} verbose false select {INT_COL} from {dbname}.ct1") tdSql.query(f"explain analyze ratio {ratio} verbose false select {INT_COL} from {dbname}.ct1")
tdSql.query(f"explain analyze ratio {ratio} verbose false select 1 from {dbname}.ct2") tdSql.query(f"explain analyze ratio {ratio} verbose false select 1 from {dbname}.ct2")
......
...@@ -29,6 +29,8 @@ DBNAME = "db" ...@@ -29,6 +29,8 @@ DBNAME = "db"
class TDTestCase: class TDTestCase:
updatecfgDict = {"maxTablesPerVnode":2 ,"minTablesPerVnode":2,"tableIncStepPerVnode":2 }
def init(self, conn, logSql): def init(self, conn, logSql):
tdLog.debug(f"start to excute {__file__}") tdLog.debug(f"start to excute {__file__}")
tdSql.init(conn.cursor()) tdSql.init(conn.cursor())
......
...@@ -37,6 +37,8 @@ class TDTestCase: ...@@ -37,6 +37,8 @@ class TDTestCase:
tdSql.execute(f"insert into {dbname}.{tbname} values ('2020-02-01 00:00:10', 10, 10, 10, 10, 10.0, 10.0, true, 'varchar', 'nchar')") tdSql.execute(f"insert into {dbname}.{tbname} values ('2020-02-01 00:00:10', 10, 10, 10, 10, 10.0, 10.0, true, 'varchar', 'nchar')")
tdSql.execute(f"insert into {dbname}.{tbname} values ('2020-02-01 00:00:15', 15, 15, 15, 15, 15.0, 15.0, true, 'varchar', 'nchar')") tdSql.execute(f"insert into {dbname}.{tbname} values ('2020-02-01 00:00:15', 15, 15, 15, 15, 15.0, 15.0, true, 'varchar', 'nchar')")
tdSql.execute(f"insert into {dbname}.{tbname} (ts) values (now)")
tdLog.printNoPrefix("==========step3:fill null") tdLog.printNoPrefix("==========step3:fill null")
## {. . .} ## {. . .}
...@@ -244,7 +246,7 @@ class TDTestCase: ...@@ -244,7 +246,7 @@ class TDTestCase:
## {. . .} ## {. . .}
tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(next)") tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(next)")
tdSql.checkRows(12) tdSql.checkRows(13)
tdSql.checkData(0, 0, 5) tdSql.checkData(0, 0, 5)
tdSql.checkData(1, 0, 5) tdSql.checkData(1, 0, 5)
tdSql.checkData(2, 0, 10) tdSql.checkData(2, 0, 10)
...@@ -294,21 +296,21 @@ class TDTestCase: ...@@ -294,21 +296,21 @@ class TDTestCase:
## ..{.} ## ..{.}
tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:13', '2020-02-01 00:00:17') every(1s) fill(next)") tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:13', '2020-02-01 00:00:17') every(1s) fill(next)")
tdSql.checkRows(3) tdSql.checkRows(5)
tdSql.checkData(0, 0, 15) tdSql.checkData(0, 0, 15)
tdSql.checkData(1, 0, 15) tdSql.checkData(1, 0, 15)
tdSql.checkData(2, 0, 15) tdSql.checkData(2, 0, 15)
## ... {} ## ... {}
tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(next)") tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:16', '2020-02-01 00:00:19') every(1s) fill(next)")
tdSql.checkRows(0) tdSql.checkRows(4)
tdLog.printNoPrefix("==========step7:fill linear") tdLog.printNoPrefix("==========step7:fill linear")
## {. . .} ## {. . .}
tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)")
tdSql.checkRows(11) tdSql.checkRows(12)
tdSql.checkData(0, 0, 5) tdSql.checkData(0, 0, 5)
tdSql.checkData(1, 0, 6) tdSql.checkData(1, 0, 6)
tdSql.checkData(2, 0, 7) tdSql.checkData(2, 0, 7)
...@@ -351,7 +353,7 @@ class TDTestCase: ...@@ -351,7 +353,7 @@ class TDTestCase:
## ..{.} ## ..{.}
tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:13', '2020-02-01 00:00:17') every(1s) fill(linear)") tdSql.query(f"select interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:13', '2020-02-01 00:00:17') every(1s) fill(linear)")
tdSql.checkRows(3) tdSql.checkRows(5)
tdSql.checkData(0, 0, 13) tdSql.checkData(0, 0, 13)
tdSql.checkData(1, 0, 14) tdSql.checkData(1, 0, 14)
tdSql.checkData(2, 0, 15) tdSql.checkData(2, 0, 15)
...@@ -509,7 +511,7 @@ class TDTestCase: ...@@ -509,7 +511,7 @@ class TDTestCase:
tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') tdSql.checkData(8, 0, '2020-02-01 00:00:12.000')
tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(next)") tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(next)")
tdSql.checkRows(12) tdSql.checkRows(13)
tdSql.checkCols(2) tdSql.checkCols(2)
tdSql.checkData(0, 0, '2020-02-01 00:00:04.000') tdSql.checkData(0, 0, '2020-02-01 00:00:04.000')
...@@ -552,7 +554,7 @@ class TDTestCase: ...@@ -552,7 +554,7 @@ class TDTestCase:
tdSql.checkData(8, 0, '2020-02-01 00:00:12.000') tdSql.checkData(8, 0, '2020-02-01 00:00:12.000')
tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") tdSql.query(f"select _irowts,interp(c0) from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)")
tdSql.checkRows(11) tdSql.checkRows(12)
tdSql.checkCols(2) tdSql.checkCols(2)
tdSql.checkData(0, 0, '2020-02-01 00:00:05.000') tdSql.checkData(0, 0, '2020-02-01 00:00:05.000')
...@@ -580,7 +582,7 @@ class TDTestCase: ...@@ -580,7 +582,7 @@ class TDTestCase:
# multiple _irowts # multiple _irowts
tdSql.query(f"select interp(c0),_irowts from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") tdSql.query(f"select interp(c0),_irowts from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)")
tdSql.checkRows(11) tdSql.checkRows(12)
tdSql.checkCols(2) tdSql.checkCols(2)
tdSql.checkData(0, 1, '2020-02-01 00:00:05.000') tdSql.checkData(0, 1, '2020-02-01 00:00:05.000')
...@@ -596,7 +598,7 @@ class TDTestCase: ...@@ -596,7 +598,7 @@ class TDTestCase:
tdSql.checkData(10, 1, '2020-02-01 00:00:15.000') tdSql.checkData(10, 1, '2020-02-01 00:00:15.000')
tdSql.query(f"select _irowts, interp(c0), interp(c0), _irowts from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)") tdSql.query(f"select _irowts, interp(c0), interp(c0), _irowts from {dbname}.{tbname} range('2020-02-01 00:00:04', '2020-02-01 00:00:16') every(1s) fill(linear)")
tdSql.checkRows(11) tdSql.checkRows(12)
tdSql.checkCols(4) tdSql.checkCols(4)
cols = (0, 3) cols = (0, 3)
...@@ -881,6 +883,10 @@ class TDTestCase: ...@@ -881,6 +883,10 @@ class TDTestCase:
tdSql.checkRows(3) tdSql.checkRows(3)
tdSql.checkCols(4) tdSql.checkCols(4)
tdSql.query(f"select interp(c0),interp(c1),interp(c2),interp(c3),interp(c4),interp(c5) from {dbname}.{tbname} range('2020-02-09 00:00:05', '2020-02-13 00:00:05') every(1d) fill(linear)")
tdSql.checkRows(3)
tdSql.checkCols(6)
for i in range (tdSql.queryCols): for i in range (tdSql.queryCols):
tdSql.checkData(0, i, 13) tdSql.checkData(0, i, 13)
......
...@@ -24,7 +24,7 @@ class TDTestCase: ...@@ -24,7 +24,7 @@ class TDTestCase:
tdSql.execute(f"create database if not exists {dbname} keep 3650 duration 1000 vgroups 5") tdSql.execute(f"create database if not exists {dbname} keep 3650 duration 1000 vgroups 5")
tdSql.execute( tdSql.execute(
f'''create table {dbname}.stb1 f'''create table {dbname}.stb1
(ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp) (ts timestamp, c1 int, c2 bigint, c3 smallint, c4 tinyint, c5 float, c6 double, c7 bool, c8 binary(16),c9 nchar(32), c10 timestamp,c11 int UNSIGNED, c12 bigint UNSIGNED, c13 smallint UNSIGNED, c14 tinyint UNSIGNED)
tags (t0 timestamp, t1 int, t2 bigint, t3 smallint, t4 tinyint, t5 float, t6 double, t7 bool, t8 binary(16),t9 nchar(32)) tags (t0 timestamp, t1 int, t2 bigint, t3 smallint, t4 tinyint, t5 float, t6 double, t7 bool, t8 binary(16),t9 nchar(32))
''' '''
) )
...@@ -35,12 +35,12 @@ class TDTestCase: ...@@ -35,12 +35,12 @@ class TDTestCase:
for j in range(self.row_nums): for j in range(self.row_nums):
ts+=j*self.time_step ts+=j*self.time_step
tdSql.execute( tdSql.execute(
f"insert into {dbname}.ct{i+1} values({ts}, 1, 11111, 111, 1, 1.11, 11.11, 2, 'binary{j}', 'nchar{j}', now()+{1*j}a )" f"insert into {dbname}.ct{i+1} values({ts}, 1, 11111, 111, 1, 1.11, 11.11, 2, 'binary{j}', 'nchar{j}', now()+{1*j}a, 1, 11111, 111, 1 )"
) )
tdSql.execute(f"insert into {dbname}.ct1 values (now()-810d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ") tdSql.execute(f"insert into {dbname}.ct1 values (now()-810d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute(f"insert into {dbname}.ct1 values (now()-400d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ") tdSql.execute(f"insert into {dbname}.ct1 values (now()-400d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ")
tdSql.execute(f"insert into {dbname}.ct1 values (now()+90d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL ) ") tdSql.execute(f"insert into {dbname}.ct1 values (now()+90d, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL , NULL, NULL, NULL, NULL ) ")
tdLog.info(" prepare data for distributed_aggregate done! ") tdLog.info(" prepare data for distributed_aggregate done! ")
...@@ -48,7 +48,7 @@ class TDTestCase: ...@@ -48,7 +48,7 @@ class TDTestCase:
tdSql.query(f"desc {dbname}.stb1 ") tdSql.query(f"desc {dbname}.stb1 ")
schema_list = tdSql.queryResult schema_list = tdSql.queryResult
for col_type in schema_list: for col_type in schema_list:
if col_type[1] in ["TINYINT" ,"SMALLINT","BIGINT" ,"INT","FLOAT","DOUBLE"]: if col_type[1] in ["TINYINT" ,"SMALLINT","BIGINT" ,"INT","FLOAT","DOUBLE","TINYINT UNSIGNED" ,"SMALLINT UNSIGNED","BIGINT UNSIGNED" ,"INT UNSIGNED"]:
tdSql.query(f"select twa({col_type[0]}) from {dbname}.stb1 partition by tbname ") tdSql.query(f"select twa({col_type[0]}) from {dbname}.stb1 partition by tbname ")
else: else:
tdSql.error(f"select twa({col_type[0]}) from {dbname}.stb1 partition by tbname ") tdSql.error(f"select twa({col_type[0]}) from {dbname}.stb1 partition by tbname ")
...@@ -99,10 +99,56 @@ class TDTestCase: ...@@ -99,10 +99,56 @@ class TDTestCase:
tdSql.checkRows(self.tb_nums) tdSql.checkRows(self.tb_nums)
tdSql.checkData(0,0,1.000000000) tdSql.checkData(0,0,1.000000000)
tdSql.query(f"select twa(c11) from {dbname}.ct1 ")
tdSql.checkData(0,0,1.000000000)
tdSql.query(f"select twa(c11) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(self.tb_nums)
tdSql.checkData(0,0,1.000000000)
tdSql.query(f"select twa(c12) from {dbname}.stb1 group by tbname ")
tdSql.checkRows(self.tb_nums)
tdSql.checkData(0,0,11111.000000000)
tdSql.query(f"select twa(c11+c12) from {dbname}.stb1 partition by tbname ")
tdSql.checkData(0,0,11112.000000000)
tdSql.query(f"select twa(c11) from {dbname}.stb1 partition by t1")
tdSql.checkRows(self.tb_nums)
tdSql.checkData(0,0,1.000000000)
tdSql.query(f"select twa(c13) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(self.tb_nums)
tdSql.query(f"select twa(c13) from {dbname}.stb1 group by tbname ")
tdSql.checkRows(self.tb_nums)
tdSql.query(f"select twa(c14) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(self.tb_nums)
tdSql.query(f"select twa(c14) from {dbname}.stb1 group by tbname ")
tdSql.checkRows(self.tb_nums)
# union all # union all
tdSql.query(f"select twa(c1) from {dbname}.stb1 partition by tbname union all select twa(c1) from {dbname}.stb1 partition by tbname ") tdSql.query(f"select twa(c1) from {dbname}.stb1 partition by tbname union all select twa(c1) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(40) tdSql.checkRows(40)
tdSql.checkData(0,0,1.000000000) tdSql.checkData(0,0,1.000000000)
tdSql.query(f"select twa(c11) from {dbname}.stb1 partition by tbname union all select twa(c11) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(40)
tdSql.checkData(0,0,1.000000000)
tdSql.query(f"select twa(c2) from {dbname}.stb1 partition by tbname union all select twa(c2) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(40)
tdSql.query(f"select twa(c3) from {dbname}.stb1 partition by tbname union all select twa(c3) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(40)
tdSql.query(f"select twa(c4) from {dbname}.stb1 partition by tbname union all select twa(c4) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(40)
tdSql.query(f"select twa(c12) from {dbname}.stb1 partition by tbname union all select twa(c12) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(40)
tdSql.query(f"select twa(c13) from {dbname}.stb1 partition by tbname union all select twa(c13) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(40)
tdSql.query(f"select twa(c14) from {dbname}.stb1 partition by tbname union all select twa(c14) from {dbname}.stb1 partition by tbname ")
tdSql.checkRows(40)
# join # join
...@@ -123,6 +169,7 @@ class TDTestCase: ...@@ -123,6 +169,7 @@ class TDTestCase:
tdSql.checkData(0,0,4.500000000) tdSql.checkData(0,0,4.500000000)
tdSql.checkData(0,1,4.500000000) tdSql.checkData(0,1,4.500000000)
# mixup with other functions # mixup with other functions
tdSql.query(f"select twa(c1),twa(c2),max(c1),elapsed(ts) from {dbname}.ct1 ") tdSql.query(f"select twa(c1),twa(c2),max(c1),elapsed(ts) from {dbname}.ct1 ")
tdSql.checkData(0,0,1.000000000) tdSql.checkData(0,0,1.000000000)
......
...@@ -593,7 +593,7 @@ python3 ./test.py -f 2-query/arccos.py -Q 4 ...@@ -593,7 +593,7 @@ python3 ./test.py -f 2-query/arccos.py -Q 4
python3 ./test.py -f 2-query/arctan.py -Q 4 python3 ./test.py -f 2-query/arctan.py -Q 4
python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 4 python3 ./test.py -f 2-query/query_cols_tags_and_or.py -Q 4
#python3 ./test.py -f 2-query/nestedQuery.py -Q 4 python3 ./test.py -f 2-query/nestedQuery.py -Q 4
python3 ./test.py -f 2-query/nestedQuery_str.py -Q 4 python3 ./test.py -f 2-query/nestedQuery_str.py -Q 4
python3 ./test.py -f 2-query/nestedQuery_math.py -Q 4 python3 ./test.py -f 2-query/nestedQuery_math.py -Q 4
python3 ./test.py -f 2-query/nestedQuery_time.py -Q 4 python3 ./test.py -f 2-query/nestedQuery_time.py -Q 4
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册