handle 0 result case for groups

This commit is contained in:
Ganlin Zhao 2023-06-16 16:11:56 +08:00
parent e4c9a7474e
commit 9cddf06053
1 changed files with 12 additions and 4 deletions

View File

@ -875,7 +875,13 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) {
if (pSliceInfo->pRemainRes == NULL) { if (pSliceInfo->pRemainRes == NULL) {
pSliceInfo->pNextGroupRes = NULL; pSliceInfo->pNextGroupRes = NULL;
} }
if (pResBlock->info.rows != 0) {
goto _finished; goto _finished;
} else {
// after fillter if result block has 0 rows, go back to
// process pNextGroupRes again for unfinished data
continue;
}
} }
pSliceInfo->pNextGroupRes = NULL; pSliceInfo->pNextGroupRes = NULL;
} }
@ -900,9 +906,11 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) {
doHandleTimeslice(pOperator, pBlock); doHandleTimeslice(pOperator, pBlock);
if (checkWindowBoundReached(pSliceInfo) || checkThresholdReached(pSliceInfo, pOperator->resultInfo.threshold)) { if (checkWindowBoundReached(pSliceInfo) || checkThresholdReached(pSliceInfo, pOperator->resultInfo.threshold)) {
doFilter(pResBlock, pOperator->exprSupp.pFilterInfo, NULL); doFilter(pResBlock, pOperator->exprSupp.pFilterInfo, NULL);
if (pResBlock->info.rows != 0) {
goto _finished; goto _finished;
} }
} }
}
// post work for a specific group // post work for a specific group
// check if need to interpolate after last datablock // check if need to interpolate after last datablock
@ -916,8 +924,8 @@ static SSDataBlock* doTimeslice(SOperatorInfo* pOperator) {
// restore initial value for next group // restore initial value for next group
resetTimesliceInfo(pSliceInfo); resetTimesliceInfo(pSliceInfo);
if (checkThresholdReached(pSliceInfo, pOperator->resultInfo.threshold)) { if (pResBlock->info.rows != 0) {
goto _finished; break;
} }
} }