diff --git a/include/libs/function/function.h b/include/libs/function/function.h index 6f2a675466..0831e477ff 100644 --- a/include/libs/function/function.h +++ b/include/libs/function/function.h @@ -57,7 +57,7 @@ typedef struct SFuncExecFuncs { #define MAX_INTERVAL_TIME_WINDOW 10000000 // maximum allowed time windows in final results #define TOP_BOTTOM_QUERY_LIMIT 100 -#define FUNCTIONS_NAME_MAX_LENGTH 16 +#define FUNCTIONS_NAME_MAX_LENGTH 32 typedef struct SResultRowEntryInfo { bool initialized : 1; // output buffer has been initialized diff --git a/source/libs/executor/src/executorimpl.c b/source/libs/executor/src/executorimpl.c index 402f267c6d..1f0ccf02ce 100644 --- a/source/libs/executor/src/executorimpl.c +++ b/source/libs/executor/src/executorimpl.c @@ -1604,7 +1604,9 @@ static int32_t createDataBlockForEmptyInput(SOperatorInfo* pOperator, SSDataBloc bool hasCountFunc = false; for (int32_t i = 0; i < pOperator->exprSupp.numOfExprs; ++i) { if ((strcmp(pCtx[i].pExpr->pExpr->_function.functionName, "count") == 0) || - (strcmp(pCtx[i].pExpr->pExpr->_function.functionName, "hyperloglog") == 0)) { + (strcmp(pCtx[i].pExpr->pExpr->_function.functionName, "hyperloglog") == 0) || + (strcmp(pCtx[i].pExpr->pExpr->_function.functionName, "_hyperloglog_partial") == 0) || + (strcmp(pCtx[i].pExpr->pExpr->_function.functionName, "_hyperloglog_merge") == 0)) { hasCountFunc = true; break; } diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index 35f50cebca..141cd04263 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -4787,6 +4787,10 @@ int32_t hllFunction(SqlFunctionCtx* pCtx) { int32_t numOfRows = pInput->numOfRows; int32_t numOfElems = 0; + if (IS_NULL_TYPE(type)) { + goto _hll_over; + } + for (int32_t i = start; i < numOfRows + start; ++i) { if (pCol->hasNull && colDataIsNull_s(pCol, i)) { continue; @@ -4808,6 +4812,7 @@ int32_t hllFunction(SqlFunctionCtx* pCtx) { } } +_hll_over: pInfo->totalCount += numOfElems; if (pInfo->totalCount == 0 && !tsCountAlwaysReturnValue) {