From 259815fd83aab5d41f843cd1574637a5bb1cec59 Mon Sep 17 00:00:00 2001 From: liuyao <54liuyao@163.com> Date: Thu, 13 Apr 2023 10:46:38 +0800 Subject: [PATCH] scan multiple range --- source/libs/executor/src/scanoperator.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 0ad2423ca3..8a3ac9d6a3 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -1183,14 +1183,19 @@ static STimeWindow getSlidingWindow(TSKEY* startTsCol, TSKEY* endTsCol, uint64_t static SSDataBlock* doRangeScan(SStreamScanInfo* pInfo, SSDataBlock* pSDB, int32_t tsColIndex, int32_t* pRowIndex) { qInfo("do stream range scan. windows index:%d", *pRowIndex); + bool prepareRes = true; while (1) { SSDataBlock* pResult = NULL; pResult = doTableScan(pInfo->pTableScanOp); - if (!pResult && prepareRangeScan(pInfo, pSDB, pRowIndex)) { + if (!pResult) { + prepareRes = prepareRangeScan(pInfo, pSDB, pRowIndex); // scan next window data pResult = doTableScan(pInfo->pTableScanOp); } if (!pResult) { + if (prepareRes) { + continue; + } blockDataCleanup(pSDB); *pRowIndex = 0; pInfo->updateWin = (STimeWindow){.skey = INT64_MIN, .ekey = INT64_MAX}; @@ -2057,7 +2062,7 @@ FETCH_NEXT_BLOCK: updateInfoSetScanRange(pInfo->pUpdateInfo, &pTableScanInfo->base.cond.twindows, pInfo->groupId, version); pSDB->info.type = pInfo->scanMode == STREAM_SCAN_FROM_DATAREADER_RANGE ? STREAM_NORMAL : STREAM_PULL_DATA; checkUpdateData(pInfo, true, pSDB, false); - // printDataBlock(pSDB, "stream scan update"); + printDataBlock(pSDB, "stream scan update"); calBlockTbName(pInfo, pSDB); return pSDB; }