refactor codes
This commit is contained in:
parent
2129bc1e56
commit
d1f5edb65e
|
@ -221,7 +221,7 @@ int32_t getResultDataInfo(int32_t dataType, int32_t dataBytes, int32_t functionI
|
||||||
} else if (functionId == TSDB_FUNC_TWA) {
|
} else if (functionId == TSDB_FUNC_TWA) {
|
||||||
*type = TSDB_DATA_TYPE_DOUBLE;
|
*type = TSDB_DATA_TYPE_DOUBLE;
|
||||||
*bytes = sizeof(STwaInfo);
|
*bytes = sizeof(STwaInfo);
|
||||||
*intermediateResBytes = sizeof(STwaInfo);
|
*intermediateResBytes = *bytes;
|
||||||
return TSDB_CODE_SUCCESS;
|
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) {
|
} else if (functionId == TSDB_FUNC_PERCT) {
|
||||||
*type = (int16_t)TSDB_DATA_TYPE_DOUBLE;
|
*type = (int16_t)TSDB_DATA_TYPE_DOUBLE;
|
||||||
*bytes = (int16_t)sizeof(double);
|
*bytes = (int16_t)sizeof(double);
|
||||||
//*intermediateResBytes = POINTER_BYTES;
|
|
||||||
*intermediateResBytes = (int16_t)sizeof(double);
|
*intermediateResBytes = (int16_t)sizeof(double);
|
||||||
} else if (functionId == TSDB_FUNC_LEASTSQR) {
|
} else if (functionId == TSDB_FUNC_LEASTSQR) {
|
||||||
*type = TSDB_DATA_TYPE_BINARY;
|
*type = TSDB_DATA_TYPE_BINARY;
|
||||||
|
|
|
@ -85,10 +85,15 @@ typedef struct SQueryCostSummary {
|
||||||
int64_t tmpBufferInDisk; // size of buffer for intermediate result
|
int64_t tmpBufferInDisk; // size of buffer for intermediate result
|
||||||
} SQueryCostSummary;
|
} SQueryCostSummary;
|
||||||
|
|
||||||
|
typedef struct SPosInfo {
|
||||||
|
int64_t pageId;
|
||||||
|
int32_t rowId;
|
||||||
|
} SPosInfo;
|
||||||
|
|
||||||
typedef struct SOutputRes {
|
typedef struct SOutputRes {
|
||||||
uint16_t numOfRows;
|
uint16_t numOfRows;
|
||||||
int32_t nAlloc;
|
int32_t nAlloc;
|
||||||
tFilePage** result;
|
SPosInfo pos;
|
||||||
SResultInfo* resultInfo;
|
SResultInfo* resultInfo;
|
||||||
} SOutputRes;
|
} 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.
|
* So we keep a copy of the support structure as well as the cache block data itself.
|
||||||
*/
|
*/
|
||||||
SCacheBlock cacheBlock;
|
SCacheBlock cacheBlock;
|
||||||
|
|
||||||
|
SQueryResultBuf* pResultBuf;
|
||||||
|
bool stableQuery; // is super table query or not
|
||||||
} SQueryRuntimeEnv;
|
} SQueryRuntimeEnv;
|
||||||
|
|
||||||
/* intermediate result during multimeter query involves interval */
|
/* intermediate pos during multimeter query involves interval */
|
||||||
typedef struct SMeterQueryInfo {
|
typedef struct SMeterQueryInfo {
|
||||||
int64_t lastKey;
|
int64_t lastKey;
|
||||||
int64_t skey;
|
int64_t skey;
|
||||||
int64_t ekey;
|
int64_t ekey;
|
||||||
int32_t numOfRes;
|
int32_t numOfRes;
|
||||||
// uint32_t numOfPages;
|
|
||||||
// uint32_t numOfAlloc;
|
|
||||||
int32_t reverseIndex; // reversed output indicator, start from (numOfRes-1)
|
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 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
|
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;
|
int64_t tag;
|
||||||
STSCursor cur;
|
STSCursor cur;
|
||||||
SResultInfo* resultInfo;
|
SResultInfo* resultInfo;
|
||||||
// uint32_t* pageList;
|
|
||||||
// SIDList pageIdList;
|
|
||||||
int32_t sid; // for retrieve the page id list
|
int32_t sid; // for retrieve the page id list
|
||||||
} SMeterQueryInfo;
|
} SMeterQueryInfo;
|
||||||
|
|
||||||
|
@ -238,16 +242,8 @@ typedef struct SMeterQuerySupportObj {
|
||||||
*/
|
*/
|
||||||
int32_t meterIdx;
|
int32_t meterIdx;
|
||||||
|
|
||||||
// int32_t meterOutputFd;
|
|
||||||
// int32_t lastPageId;
|
|
||||||
// int32_t numOfPages;
|
|
||||||
int32_t numOfGroupResultPages;
|
int32_t numOfGroupResultPages;
|
||||||
int32_t groupResultSize;
|
int32_t groupResultSize;
|
||||||
SQueryResultBuf* pResultBuf;
|
|
||||||
// char* meterOutputMMapBuf;
|
|
||||||
// int64_t bufSize;
|
|
||||||
// char extBufFile[256]; // external file name
|
|
||||||
|
|
||||||
SMeterDataInfo* pMeterDataInfo;
|
SMeterDataInfo* pMeterDataInfo;
|
||||||
|
|
||||||
TSKEY* tsList;
|
TSKEY* tsList;
|
||||||
|
|
|
@ -858,7 +858,7 @@ static void doOrderedScan(SQInfo *pQInfo) {
|
||||||
static void setupMeterQueryInfoForSupplementQuery(SMeterQuerySupportObj *pSupporter) {
|
static void setupMeterQueryInfoForSupplementQuery(SMeterQuerySupportObj *pSupporter) {
|
||||||
for (int32_t i = 0; i < pSupporter->numOfMeters; ++i) {
|
for (int32_t i = 0; i < pSupporter->numOfMeters; ++i) {
|
||||||
SMeterQueryInfo *pMeterQueryInfo = pSupporter->pMeterDataInfo[i].pMeterQInfo;
|
SMeterQueryInfo *pMeterQueryInfo = pSupporter->pMeterDataInfo[i].pMeterQInfo;
|
||||||
SQueryResultBuf* pResultBuf = pSupporter->pResultBuf;
|
SQueryResultBuf* pResultBuf = pSupporter->runtimeEnv.pResultBuf;
|
||||||
|
|
||||||
changeMeterQueryInfoForSuppleQuery(pResultBuf, pMeterQueryInfo, pSupporter->rawSKey, pSupporter->rawEKey);
|
changeMeterQueryInfoForSuppleQuery(pResultBuf, pMeterQueryInfo, pSupporter->rawSKey, pSupporter->rawEKey);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue