fix decimal ci test

This commit is contained in:
wangjiaming0909 2025-03-08 13:52:36 +08:00
parent 4d727512e2
commit f4dbaf2240
1 changed files with 2 additions and 3 deletions

View File

@ -637,11 +637,10 @@ int32_t avgFinalize(SqlFunctionCtx* pCtx, SSDataBlock* pBlock) {
AVG_RES_GET_AVG(pRes) = SUM_RES_GET_DSUM(&AVG_RES_GET_SUM(pRes)) / ((double)AVG_RES_GET_COUNT(pRes, false, 0));
}
}
if (!IS_DECIMAL_TYPE(pCtx->inputType)) {
if (isinf(AVG_RES_GET_AVG(pRes)) || isnan(AVG_RES_GET_AVG(pRes))) pEntryInfo->numOfRes = 0;
}
if (AVG_RES_GET_COUNT(pRes, true, pCtx->inputType) == 0) {
pEntryInfo->numOfRes = 0;
} else if (!IS_DECIMAL_TYPE(pCtx->inputType)) {
if (isinf(AVG_RES_GET_AVG(pRes)) || isnan(AVG_RES_GET_AVG(pRes))) pEntryInfo->numOfRes = 0;
} else {
pEntryInfo->numOfRes = 1;
}