From f4dbaf22407d742f604a5177402ace42f876b9fa Mon Sep 17 00:00:00 2001 From: wangjiaming0909 Date: Sat, 8 Mar 2025 13:52:36 +0800 Subject: [PATCH] fix decimal ci test --- source/libs/function/src/detail/tavgfunction.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source/libs/function/src/detail/tavgfunction.c b/source/libs/function/src/detail/tavgfunction.c index 4e38fb7ce6..f3d77123d5 100644 --- a/source/libs/function/src/detail/tavgfunction.c +++ b/source/libs/function/src/detail/tavgfunction.c @@ -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; }