diff --git a/src/client/src/tscFunctionImpl.c b/src/client/src/tscFunctionImpl.c index f8a8d0d6a7cecc632112a364cfbd502b1a6dd47c..b7543cb42dcc24e3d5aa30c8b0769c7a6ddc22c4 100644 --- a/src/client/src/tscFunctionImpl.c +++ b/src/client/src/tscFunctionImpl.c @@ -221,7 +221,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI } else if (functionId == TSDB_FUNC_TWA) { *type = TSDB_DATA_TYPE_DOUBLE; *bytes = sizeof(STwaInfo); - *intermediateResBytes = sizeof(STwaInfo); + *intermediateResBytes = *bytes; return TSDB_CODE_SUCCESS; } } @@ -272,7 +272,6 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI } else if (functionId == TSDB_FUNC_PERCT) { *type = (int16_t)TSDB_DATA_TYPE_DOUBLE; *bytes = (int16_t)sizeof(double); - //*intermediateResBytes = POINTER_BYTES; *intermediateResBytes = (int16_t)sizeof(double); } else if (functionId == TSDB_FUNC_LEASTSQR) { *type = TSDB_DATA_TYPE_BINARY; diff --git a/src/system/detail/inc/vnodeRead.h b/src/system/detail/inc/vnodeRead.h index 321b837c771fc4e2aa815ef102a2a76346e3d845..ed7b965acbd664953a5a68e6350940fd5f7145ee 100644 --- a/src/system/detail/inc/vnodeRead.h +++ b/src/system/detail/inc/vnodeRead.h @@ -85,10 +85,15 @@ typedef struct SQueryCostSummary { int64_t tmpBufferInDisk; // size of buffer for intermediate result } SQueryCostSummary; +typedef struct SPosInfo { + int64_t pageId; + int32_t rowId; +} SPosInfo; + typedef struct SOutputRes { uint16_t numOfRows; int32_t nAlloc; - tFilePage** result; + SPosInfo pos; SResultInfo* resultInfo; } SOutputRes; @@ -175,16 +180,17 @@ typedef struct SQueryRuntimeEnv { * So we keep a copy of the support structure as well as the cache block data itself. */ SCacheBlock cacheBlock; + + SQueryResultBuf* pResultBuf; + bool stableQuery; // is super table query or not } SQueryRuntimeEnv; -/* intermediate result during multimeter query involves interval */ +/* intermediate pos during multimeter query involves interval */ typedef struct SMeterQueryInfo { int64_t lastKey; int64_t skey; int64_t ekey; int32_t numOfRes; -// uint32_t numOfPages; -// uint32_t numOfAlloc; int32_t reverseIndex; // reversed output indicator, start from (numOfRes-1) int16_t reverseFillRes; // denote if reverse fill the results in supplementary scan required or not int16_t queryRangeSet; // denote if the query range is set, only available for interval query @@ -192,8 +198,6 @@ typedef struct SMeterQueryInfo { int64_t tag; STSCursor cur; SResultInfo* resultInfo; -// uint32_t* pageList; -// SIDList pageIdList; int32_t sid; // for retrieve the page id list } SMeterQueryInfo; @@ -238,16 +242,8 @@ typedef struct SMeterQuerySupportObj { */ int32_t meterIdx; -// int32_t meterOutputFd; -// int32_t lastPageId; -// int32_t numOfPages; int32_t numOfGroupResultPages; int32_t groupResultSize; - SQueryResultBuf* pResultBuf; -// char* meterOutputMMapBuf; -// int64_t bufSize; -// char extBufFile[256]; // external file name - SMeterDataInfo* pMeterDataInfo; TSKEY* tsList; diff --git a/src/system/detail/src/vnodeQueryProcess.c b/src/system/detail/src/vnodeQueryProcess.c index 9bcbc772699f4482ef2ad4cde1329db594346a3d..278d334c8e57652488389646a91de203cc791867 100644 --- a/src/system/detail/src/vnodeQueryProcess.c +++ b/src/system/detail/src/vnodeQueryProcess.c @@ -858,7 +858,7 @@ static void doOrderedScan(SQInfo *pQInfo) { static void setupMeterQueryInfoForSupplementQuery(SMeterQuerySupportObj *pSupporter) { for (int32_t i = 0; i < pSupporter->numOfMeters; ++i) { SMeterQueryInfo *pMeterQueryInfo = pSupporter->pMeterDataInfo[i].pMeterQInfo; - SQueryResultBuf* pResultBuf = pSupporter->pResultBuf; + SQueryResultBuf* pResultBuf = pSupporter->runtimeEnv.pResultBuf; changeMeterQueryInfoForSuppleQuery(pResultBuf, pMeterQueryInfo, pSupporter->rawSKey, pSupporter->rawEKey); }