From 96fc85017b68de17e11b360f44edd7fa384dbe39 Mon Sep 17 00:00:00 2001 From: Haojun Liao Date: Sun, 7 Apr 2024 16:51:40 +0800 Subject: [PATCH] fix(query): fix error in interp --- source/libs/executor/src/timesliceoperator.c | 21 +++----------------- 1 file changed, 3 insertions(+), 18 deletions(-) diff --git a/source/libs/executor/src/timesliceoperator.c b/source/libs/executor/src/timesliceoperator.c index 9b28a203b8..080fd6b914 100644 --- a/source/libs/executor/src/timesliceoperator.c +++ b/source/libs/executor/src/timesliceoperator.c @@ -206,28 +206,14 @@ static bool checkDuplicateTimestamps(STimeSliceOperatorInfo* pSliceInfo, SColumn cur.pks[0].type = pPkCol->info.type; } + // let's discard the duplicated ts if ((pSliceInfo->prevTsSet == true) && (currentTs == pSliceInfo->prevKey.ts)) { -// if (pPkCol == NULL) { - return true; - /* } else { - tRowGetKeyFromColData(currentTs, pPkCol, curIndex, &cur); - if (tRowKeyCompare(&cur, &pSliceInfo->prevKey) == 0) { - return true; - } - }*/ + return true; } pSliceInfo->prevTsSet = true; tRowKeyAssign(&pSliceInfo->prevKey, &cur); - // todo handle next - if (currentTs == pSliceInfo->win.ekey && curIndex < rows - 1) { - int64_t nextTs = *(int64_t*)colDataGetData(pTsCol, curIndex + 1); - if (currentTs == nextTs) { - return true; - } - } - return false; } @@ -735,7 +721,6 @@ static void doTimesliceImpl(SOperatorInfo* pOperator, STimeSliceOperatorInfo* pS // check for duplicate timestamps if (checkDuplicateTimestamps(pSliceInfo, pTsCol, pPkCol, i, pBlock->info.rows)) { continue; -// T_LONG_JMP(pTaskInfo->env, TSDB_CODE_FUNC_DUP_TIMESTAMP); } if (checkNullRow(&pOperator->exprSupp, pBlock, i, ignoreNull)) { @@ -754,6 +739,7 @@ static void doTimesliceImpl(SOperatorInfo* pOperator, STimeSliceOperatorInfo* pS if (checkWindowBoundReached(pSliceInfo)) { break; } + if (checkThresholdReached(pSliceInfo, pOperator->resultInfo.threshold)) { saveBlockStatus(pSliceInfo, pBlock, i); return; @@ -828,7 +814,6 @@ static void doTimesliceImpl(SOperatorInfo* pOperator, STimeSliceOperatorInfo* pS // if reached here, meaning block processing finished naturally, // or interpolation reach window upper bound pSliceInfo->pRemainRes = NULL; - } static void genInterpAfterDataBlock(STimeSliceOperatorInfo* pSliceInfo, SOperatorInfo* pOperator, int32_t index) {