From 8ff3f8e25ef0f3d0c414c1fed4e4849b2d44bb26 Mon Sep 17 00:00:00 2001 From: shenglian zhou Date: Wed, 6 Dec 2023 08:48:29 +0800 Subject: [PATCH] enhance: add duration order change by file /tmp/duration --- source/libs/executor/src/scanoperator.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 9a556a4ea1..3fc228503a 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -12,6 +12,7 @@ * You should have received a copy of the GNU Affero General Public License * along with this program. If not, see . */ +#define ALLOW_FORBID_FUNC #include "executorInt.h" #include "filter.h" @@ -3423,10 +3424,17 @@ int32_t startGroupTableMergeScan(SOperatorInfo* pOperator) { STableKeyInfo* startKeyInfo = tableListGetInfo(pInfo->base.pTableListInfo, tableStartIdx); pAPI->tsdReader.tsdReaderOpen(pHandle->vnode, &pInfo->base.cond, startKeyInfo, numOfTable, pInfo->pReaderBlock, (void**)&pInfo->base.dataReader, GET_TASKID(pTaskInfo), false, &pInfo->mSkipTables); - int32_t r = taosRand() % 2; + int r = 1; + FILE* f = fopen("/tmp/duration", "r"); + if (f) { + fscanf(f, "%d", &r); + fclose(f); + } if (r == 1) { - uInfo("zsl: set duration order"); + uInfo("zsl: DURATION ORDER"); pAPI->tsdReader.tsdSetDurationOrder(pInfo->base.dataReader); + } else { + uInfo("zsl: NO DURATION"); } pAPI->tsdReader.tsdSetSetNotifyCb(pInfo->base.dataReader, tableMergeScanTsdbNotifyCb, pInfo);