adjust
This commit is contained in:
parent
3faf1514f4
commit
42f9d54a70
|
@ -770,7 +770,8 @@ static SSDataBlock* doGroupedTableScan(SOperatorInfo* pOperator, const STableKey
|
|||
STableScanInfo* pTableScanInfo = pOperator->info;
|
||||
SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo;
|
||||
SStorageAPI* pAPI = &pTaskInfo->storageAPI;
|
||||
bool outputAll = pTableScanInfo->base.pTableListInfo->oneTableForEachGroup;
|
||||
// Only when all tables are scanned can you determine how many groups the tag has
|
||||
bool outputAll = true;
|
||||
|
||||
// The read handle is not initialized yet, since no qualified tables exists
|
||||
if (pTableScanInfo->base.dataReader == NULL || pOperator->status == OP_EXEC_DONE) {
|
||||
|
|
|
@ -40,9 +40,6 @@ class TDTestCase:
|
|||
tdSql.query(f"select count(*) from {self.dbname}.{self.stable} group by tbname ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
tdSql.query(f"select count(*), sum(1) from {self.dbname}.{self.stable} group by tbname ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
tdSql.query(f"select tbname, count(*) from {self.dbname}.{self.stable} group by tbname ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
|
@ -57,12 +54,13 @@ class TDTestCase:
|
|||
tdSql.checkRows(check_num - real_num)
|
||||
|
||||
# tag
|
||||
tdSql.query(f"select count(*) from {self.dbname}.{self.stable} group by t2 ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
tdSql.query(f"select t2, count(*) from {self.dbname}.{self.stable} group by t2 ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
# multi tag
|
||||
tdSql.query(f"select t2, t3, tbname, count(*) from {self.dbname}.{self.stable} group by t2, t3, tbname")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
# having
|
||||
tdSql.query(f"select t2, count(*) from {self.dbname}.{self.stable} group by t2 having count(*) <= 0")
|
||||
tdSql.checkRows(check_num - real_num)
|
||||
|
@ -87,10 +85,16 @@ class TDTestCase:
|
|||
tdSql.query(f"select * from (select count(c1) from {self.dbname}.{self.stable} group by tbname) ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
# count + sum(col)
|
||||
# multi agg
|
||||
tdSql.query(f"select count(*), sum(c1) from {self.dbname}.{self.stable} group by tbname ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
tdSql.query(f"select count(1), sum(1) from {self.dbname}.{self.stable} group by tbname ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
tdSql.query(f" select count(c1), max(c1), avg(c1), elapsed(ts), spread(c1) from {self.dbname}.{self.stable} group by tbname")
|
||||
tdSql.checkRows(real_num)
|
||||
|
||||
############### same with old ###############
|
||||
tdSql.query(f"select c1, count(*) from {self.dbname}.{self.stable} group by c1 ")
|
||||
num = 0
|
||||
|
@ -105,14 +109,20 @@ class TDTestCase:
|
|||
tdSql.query(f"select t2, c1, count(*) from {self.dbname}.{self.stable} group by t2, c1 ")
|
||||
tdSql.checkRows(real_num * self.row_nums)
|
||||
|
||||
tdSql.query(f"select t2, t3, c1, count(*) from {self.dbname}.{self.stable} group by t2, t3, c1 ")
|
||||
tdSql.checkRows(real_num * self.row_nums)
|
||||
|
||||
|
||||
def test_partitionby(self, check_num, real_num):
|
||||
tdSql.query(f"select tbname , count(*) from {self.dbname}.{self.stable} partition by tbname ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
tdSql.query(f"select tbname, count(*) from {self.dbname}.{self.stable} partition by tbname ")
|
||||
tdSql.query(f"select count(*), sum(1) from {self.dbname}.{self.stable} partition by tbname ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
tdSql.query(f" select count(c5), max(c5), avg(c5), elapsed(ts), spread(c1) from {self.dbname}.{self.stable} partition by tbname")
|
||||
tdSql.checkRows(real_num)
|
||||
|
||||
tdSql.query(f"select tbname from {self.dbname}.{self.stable} partition by tbname order by count(*)")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
|
@ -124,12 +134,12 @@ class TDTestCase:
|
|||
tdSql.checkRows(check_num - real_num)
|
||||
|
||||
#tag
|
||||
tdSql.query(f"select count(*) from {self.dbname}.{self.stable} partition by t2 ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
tdSql.query(f"select t2, count(*) from {self.dbname}.{self.stable} partition by t2 ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
tdSql.query(f"select t2, t3, tbname, count(*) from {self.dbname}.{self.stable} partition by t2, t3, tbname")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
# having
|
||||
tdSql.query(f"select t2, count(*) from {self.dbname}.{self.stable} partition by t2 having count(*) <= 0")
|
||||
tdSql.checkRows(check_num - real_num)
|
||||
|
@ -150,6 +160,13 @@ class TDTestCase:
|
|||
tdSql.query(f"select count(c1) from {self.dbname}.{self.stable} partition by tbname ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
#multi agg
|
||||
tdSql.query(f"select count(1), sum(1) from {self.dbname}.{self.stable} partition by tbname ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
||||
tdSql.query(f" select count(c1), max(c1), avg(c1), elapsed(ts), spread(c1) from {self.dbname}.{self.stable} partition by tbname")
|
||||
tdSql.checkRows(real_num)
|
||||
|
||||
#inner select
|
||||
tdSql.query(f"select * from (select count(c1) from {self.dbname}.{self.stable} partition by tbname) ")
|
||||
tdSql.checkRows(check_num)
|
||||
|
@ -170,6 +187,9 @@ class TDTestCase:
|
|||
tdSql.query(f"select t2, c1, count(*) from {self.dbname}.{self.stable} partition by t2, c1 ")
|
||||
tdSql.checkRows(real_num * self.row_nums)
|
||||
|
||||
tdSql.query(f"select t2, t3, c1, count(*) from {self.dbname}.{self.stable} partition by t2, t3, c1 ")
|
||||
tdSql.checkRows(real_num * self.row_nums)
|
||||
|
||||
def test_error(self):
|
||||
tdSql.error(f"select * from {self.dbname}.{self.stable} group by t2")
|
||||
tdSql.error(f"select t2, count(*) from {self.dbname}.{self.stable} group by t2 where t2 = 1")
|
||||
|
|
Loading…
Reference in New Issue