From ec4874f6b65150b2e10e65eb229d6dd588667155 Mon Sep 17 00:00:00 2001 From: Ganlin Zhao Date: Tue, 12 Jul 2022 10:55:51 +0800 Subject: [PATCH] enh(query): spread 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 c6f9565bda..1a4821b982 100644 --- a/source/libs/function/src/builtinsimpl.c +++ b/source/libs/function/src/builtinsimpl.c @@ -3707,11 +3707,13 @@ int32_t spreadFunctionMerge(SqlFunctionCtx* pCtx) { SSpreadInfo* pInfo = GET_ROWCELL_INTERBUF(GET_RES_INFO(pCtx)); - int32_t start = pInput->startRowIndex; - char* data = colDataGetData(pCol, start); - SSpreadInfo* pInputInfo = (SSpreadInfo*)varDataVal(data); + int32_t start = pInput->startRowIndex; - spreadTransferInfo(pInputInfo, pInfo); + for(int32_t i = start; i < start + pInput->numOfRows; ++i) { + char* data = colDataGetData(pCol, i); + SSpreadInfo* pInputInfo = (SSpreadInfo*)varDataVal(data); + spreadTransferInfo(pInputInfo, pInfo); + } SET_VAL(GET_RES_INFO(pCtx), 1, 1); -- GitLab