From 66f2835af12413a95b29194b4f6ec4674d4d7a65 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 12 Jul 2022 10:55:51 +0800 Subject: [PATCH] enh(query): hyperloglog function adoption for MIA operator TD-17254 --- source/libs/function/src/builtinsimpl.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/source/libs/function/src/builtinsimpl.c b/source/libs/function/src/builtinsimpl.c index b7a2ea3edd..9aad34d609 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -4397,11 +4397,13 @@ int32_t hllFunctionMerge(SqlFunctionCtx* pCtx) { SHLLInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); - SHLLInfo* pInputInfo = (SHLLInfo*)varDataVal(data); + int32_t start = pInput->startRowIndex; - hllTransferInfo(pInputInfo, pInfo); + for(int32_t i = start; i < start + pInput->numOfRows; ++i) { + char* data = colDataGetData(pCol, i); + SHLLInfo* pInputInfo = (SHLLInfo*)varDataVal(data); + hllTransferInfo(pInputInfo, pInfo); + } SET_VAL(GET_RES_INFO(pCtx), 1, 1); return TSDB_CODE_SUCCESS; -- GitLab