add hyperloglog case
This commit is contained in:
parent
c71c2c4a92
commit
26c197f0e3
|
@ -70,11 +70,11 @@ class TDTestCase:
|
|||
f"avg(cast({tbname}.{char_col}) as bigint)",
|
||||
)
|
||||
)
|
||||
query_condition.extend(
|
||||
(
|
||||
1010,
|
||||
)
|
||||
)
|
||||
# query_condition.extend(
|
||||
# (
|
||||
# 1010,
|
||||
# )
|
||||
# )
|
||||
|
||||
return query_condition
|
||||
|
||||
|
@ -207,26 +207,31 @@ class TDTestCase:
|
|||
tdSql.checkRows(self.rows + 3)
|
||||
tdSql.query("select hyperloglog(c1) from ct4 group by c7")
|
||||
tdSql.checkRows(3)
|
||||
tdSql.query("select spread(ct2.c1) from ct4 join ct2 on ct4.ts=ct2.ts")
|
||||
tdSql.checkRows(1)
|
||||
tdSql.query("select hyperloglog(ct2.c1) from ct4 join ct2 on ct4.ts=ct2.ts")
|
||||
tdSql.checkRows(self.rows + 2)
|
||||
tdSql.query("select hyperloglog(c1), c1 from stb1")
|
||||
for i in range(tdSql.queryRows):
|
||||
tdSql.checkData(i, 0, 1) if tdSql.queryResult[i][1] else tdSql.checkData(i,0, None)
|
||||
|
||||
|
||||
|
||||
self.spread_check()
|
||||
|
||||
def __test_error(self):
|
||||
|
||||
tdLog.printNoPrefix("===step 0: err case, must return err")
|
||||
tdSql.error( "select spread() from ct1" )
|
||||
tdSql.error( "select spread(1, 2) from ct2" )
|
||||
tdSql.error( f"select spread({NUM_COL[0]}, {NUM_COL[1]}) from ct4" )
|
||||
tdSql.error( f"select spread({BOOLEAN_COL[0]}) from t1" )
|
||||
tdSql.error( f"select spread({CHAR_COL[0]}) from stb1" )
|
||||
tdSql.error( "select hyperloglog() from ct1" )
|
||||
tdSql.error( "select hyperloglog(c1, c2) from ct2" )
|
||||
tdSql.error( "select hyperloglog(1) from ct2" )
|
||||
tdSql.error( f"select hyperloglog({NUM_COL[0]}, {NUM_COL[1]}) from ct4" )
|
||||
tdSql.error( f"select hyperloglog({BOOLEAN_COL[0]}) from t1" )
|
||||
tdSql.error( f"select hyperloglog({CHAR_COL[0]}) from stb1" )
|
||||
|
||||
# tdSql.error( ''' select spread(['c1 + c1', 'c1 + c2', 'c1 + c3', 'c1 + c4', 'c1 + c5', 'c1 + c6', 'c1 + c7', 'c1 + c8', 'c1 + c9', 'c1 + c10'])
|
||||
# from ct1
|
||||
# where ['c1 + c1', 'c1 + c2', 'c1 + c3', 'c1 + c4', 'c1 + c5', 'c1 + c6', 'c1 + c7', 'c1 + c8', 'c1 + c9', 'c1 + c10'] is not null
|
||||
# group by ['c1 + c1', 'c1 + c2', 'c1 + c3', 'c1 + c4', 'c1 + c5', 'c1 + c6', 'c1 + c7', 'c1 + c8', 'c1 + c9', 'c1 + c10']
|
||||
# having ['c1 + c1', 'c1 + c2', 'c1 + c3', 'c1 + c4', 'c1 + c5', 'c1 + c6', 'c1 + c7', 'c1 + c8', 'c1 + c9', 'c1 + c10'] is not null ''' )
|
||||
# tdSql.error( "select c1 from ct1 union select c1 from ct2 union select c1 from ct4 ")
|
||||
tdSql.error( ''' select hyperloglog(['c1 + c1', 'c1 + c2', 'c1 + c3', 'c1 + c4', 'c1 + c5', 'c1 + c6', 'c1 + c7', 'c1 + c8', 'c1 + c9', 'c1 + c10'])
|
||||
from ct1
|
||||
where ['c1 + c1', 'c1 + c2', 'c1 + c3', 'c1 + c4', 'c1 + c5', 'c1 + c6', 'c1 + c7', 'c1 + c8', 'c1 + c9', 'c1 + c10'] is not null
|
||||
group by ['c1 + c1', 'c1 + c2', 'c1 + c3', 'c1 + c4', 'c1 + c5', 'c1 + c6', 'c1 + c7', 'c1 + c8', 'c1 + c9', 'c1 + c10']
|
||||
having ['c1 + c1', 'c1 + c2', 'c1 + c3', 'c1 + c4', 'c1 + c5', 'c1 + c6', 'c1 + c7', 'c1 + c8', 'c1 + c9', 'c1 + c10'] is not null ''' )
|
||||
|
||||
def all_test(self):
|
||||
self.__test_error()
|
||||
|
|
Loading…
Reference in New Issue