From 9ae476c147dde4a805ce6c74cc1fc98b61ead26a Mon Sep 17 00:00:00 2001 From: wangjiaming0909 Date: Mon, 20 May 2024 10:30:51 +0800 Subject: [PATCH] fix event window operator forget filting having clause --- source/libs/executor/src/eventwindowoperator.c | 1 + tests/system-test/2-query/group_partition.py | 3 +++ 2 files changed, 4 insertions(+) diff --git a/source/libs/executor/src/eventwindowoperator.c b/source/libs/executor/src/eventwindowoperator.c index 2cba6e3241..29907e6f1f 100644 --- a/source/libs/executor/src/eventwindowoperator.c +++ b/source/libs/executor/src/eventwindowoperator.c @@ -202,6 +202,7 @@ static SSDataBlock* eventWindowAggregate(SOperatorInfo* pOperator) { } eventWindowAggImpl(pOperator, pInfo, pBlock); + doFilter(pRes, pSup->pFilterInfo, NULL); if (pRes->info.rows >= pOperator->resultInfo.threshold) { return pRes; } diff --git a/tests/system-test/2-query/group_partition.py b/tests/system-test/2-query/group_partition.py index 4b236c1bce..c63b8af9df 100644 --- a/tests/system-test/2-query/group_partition.py +++ b/tests/system-test/2-query/group_partition.py @@ -237,6 +237,9 @@ class TDTestCase: tdSql.query(f"select tbname, count(*) from {self.dbname}.{self.stable} partition by tbname event_window start with c1 >= 0 end with c2 = 9 and t2=0;") tdSql.checkRows(1) + tdSql.query(f"select tbname, count(*) from {self.dbname}.{self.stable} partition by tbname event_window start with c1 >= 0 end with c2 = 9 and t2=0 having count(*) > 10;") + tdSql.checkRows(0) + tdSql.query(f"select tbname, count(*) from {self.dbname}.{self.stable} partition by tbname event_window start with c1 >= 0 end with c2 = 9 and _rowts>0;") tdSql.checkRows(nonempty_tb_num)