<fix>[query]:fix some syntax errors.
This commit is contained in:
parent
6af7e1810f
commit
1d51e42b0e
|
@ -712,15 +712,6 @@ SOperatorInfo* createAllMultiTableTimeIntervalOperatorInfo(STaskRuntimeEnv* pRun
|
||||||
SExprInfo* pExpr, int32_t numOfOutput);
|
SExprInfo* pExpr, int32_t numOfOutput);
|
||||||
SOperatorInfo* createTagScanOperatorInfo(STaskRuntimeEnv* pRuntimeEnv, SExprInfo* pExpr, int32_t numOfOutput);
|
SOperatorInfo* createTagScanOperatorInfo(STaskRuntimeEnv* pRuntimeEnv, SExprInfo* pExpr, int32_t numOfOutput);
|
||||||
|
|
||||||
SOperatorInfo* createMultiwaySortOperatorInfo(STaskRuntimeEnv* pRuntimeEnv, SExprInfo* pExpr, int32_t numOfOutput,
|
|
||||||
int32_t numOfRows, void* merger);
|
|
||||||
SOperatorInfo* createGlobalAggregateOperatorInfo(STaskRuntimeEnv* pRuntimeEnv, SOperatorInfo* downstream,
|
|
||||||
SExprInfo* pExpr, int32_t numOfOutput, void* param, SArray* pUdfInfo,
|
|
||||||
bool groupResultMixedUp);
|
|
||||||
|
|
||||||
SOperatorInfo* createSLimitOperatorInfo(STaskRuntimeEnv* pRuntimeEnv, SOperatorInfo* downstream, SExprInfo* pExpr,
|
|
||||||
int32_t numOfOutput, void* merger, bool multigroupResult);
|
|
||||||
|
|
||||||
SOperatorInfo* createJoinOperatorInfo(SOperatorInfo** pdownstream, int32_t numOfDownstream, SSchema* pSchema,
|
SOperatorInfo* createJoinOperatorInfo(SOperatorInfo** pdownstream, int32_t numOfDownstream, SSchema* pSchema,
|
||||||
int32_t numOfOutput);
|
int32_t numOfOutput);
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1964,30 +1964,6 @@ static void* destroySqlFunctionCtx(SqlFunctionCtx* pCtx, int32_t numOfOutput) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void doFreeQueryHandle(STaskRuntimeEnv* pRuntimeEnv) {
|
|
||||||
STaskAttr* pQueryAttr = pRuntimeEnv->pQueryAttr;
|
|
||||||
|
|
||||||
// tsdbCleanupReadHandle(pRuntimeEnv->pTsdbReadHandle);
|
|
||||||
pRuntimeEnv->pTsdbReadHandle = NULL;
|
|
||||||
|
|
||||||
// SMemRef* pMemRef = &pQueryAttr->memRef;
|
|
||||||
// assert(pMemRef->ref == 0 && pMemRef->snapshot.imem == NULL && pMemRef->snapshot.mem == NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
static void destroyTsComp(STaskRuntimeEnv* pRuntimeEnv, STaskAttr* pQueryAttr) {
|
|
||||||
if (pQueryAttr->tsCompQuery && pRuntimeEnv->outputBuf && pRuntimeEnv->outputBuf->pDataBlock &&
|
|
||||||
taosArrayGetSize(pRuntimeEnv->outputBuf->pDataBlock) > 0) {
|
|
||||||
SColumnInfoData* pColInfoData = taosArrayGet(pRuntimeEnv->outputBuf->pDataBlock, 0);
|
|
||||||
if (pColInfoData) {
|
|
||||||
TdFilePtr pFile = *(TdFilePtr*)pColInfoData->pData; // TODO refactor
|
|
||||||
if (pFile != NULL) {
|
|
||||||
taosCloseFile(&pFile);
|
|
||||||
*(TdFilePtr*)pColInfoData->pData = NULL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool isTaskKilled(SExecTaskInfo* pTaskInfo) {
|
bool isTaskKilled(SExecTaskInfo* pTaskInfo) {
|
||||||
// query has been executed more than tsShellActivityTimer, and the retrieve has not arrived
|
// query has been executed more than tsShellActivityTimer, and the retrieve has not arrived
|
||||||
// abort current query execution.
|
// abort current query execution.
|
||||||
|
@ -6347,7 +6323,6 @@ SOperatorInfo* createAllTimeIntervalOperatorInfo(STaskRuntimeEnv* pRuntimeEnv, S
|
||||||
pOperator->pExpr = pExpr;
|
pOperator->pExpr = pExpr;
|
||||||
pOperator->numOfOutput = numOfOutput;
|
pOperator->numOfOutput = numOfOutput;
|
||||||
pOperator->info = pInfo;
|
pOperator->info = pInfo;
|
||||||
pOperator->pRuntimeEnv = pRuntimeEnv;
|
|
||||||
pOperator->getNextFn = doAllIntervalAgg;
|
pOperator->getNextFn = doAllIntervalAgg;
|
||||||
pOperator->closeFn = destroyBasicOperatorInfo;
|
pOperator->closeFn = destroyBasicOperatorInfo;
|
||||||
|
|
||||||
|
@ -6443,7 +6418,6 @@ SOperatorInfo* createMultiTableTimeIntervalOperatorInfo(STaskRuntimeEnv* pRuntim
|
||||||
pOperator->pExpr = pExpr;
|
pOperator->pExpr = pExpr;
|
||||||
pOperator->numOfOutput = numOfOutput;
|
pOperator->numOfOutput = numOfOutput;
|
||||||
pOperator->info = pInfo;
|
pOperator->info = pInfo;
|
||||||
pOperator->pRuntimeEnv = pRuntimeEnv;
|
|
||||||
|
|
||||||
pOperator->getNextFn = doSTableIntervalAgg;
|
pOperator->getNextFn = doSTableIntervalAgg;
|
||||||
pOperator->closeFn = destroyBasicOperatorInfo;
|
pOperator->closeFn = destroyBasicOperatorInfo;
|
||||||
|
@ -6468,7 +6442,6 @@ SOperatorInfo* createAllMultiTableTimeIntervalOperatorInfo(STaskRuntimeEnv* pRun
|
||||||
pOperator->pExpr = pExpr;
|
pOperator->pExpr = pExpr;
|
||||||
pOperator->numOfOutput = numOfOutput;
|
pOperator->numOfOutput = numOfOutput;
|
||||||
pOperator->info = pInfo;
|
pOperator->info = pInfo;
|
||||||
pOperator->pRuntimeEnv = pRuntimeEnv;
|
|
||||||
|
|
||||||
pOperator->getNextFn = doAllSTableIntervalAgg;
|
pOperator->getNextFn = doAllSTableIntervalAgg;
|
||||||
pOperator->closeFn = destroyBasicOperatorInfo;
|
pOperator->closeFn = destroyBasicOperatorInfo;
|
||||||
|
@ -6541,52 +6514,6 @@ _error:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
SOperatorInfo* createSLimitOperatorInfo(STaskRuntimeEnv* pRuntimeEnv, SOperatorInfo* downstream, SExprInfo* pExpr,
|
|
||||||
int32_t numOfOutput, void* pMerger, bool multigroupResult) {
|
|
||||||
SSLimitOperatorInfo* pInfo = taosMemoryCalloc(1, sizeof(SSLimitOperatorInfo));
|
|
||||||
SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo));
|
|
||||||
|
|
||||||
// pInfo->orderColumnList = getResultGroupCheckColumns(pQueryAttr);
|
|
||||||
// pInfo->slimit = pQueryAttr->slimit;
|
|
||||||
// pInfo->limit = pQueryAttr->limit;
|
|
||||||
// pInfo->capacity = pResultInfo->capacity;
|
|
||||||
// pInfo->threshold = (int64_t)(pInfo->capacity * 0.8);
|
|
||||||
// pInfo->currentOffset = pQueryAttr->limit.offset;
|
|
||||||
// pInfo->currentGroupOffset = pQueryAttr->slimit.offset;
|
|
||||||
pInfo->multigroupResult = multigroupResult;
|
|
||||||
|
|
||||||
// TODO refactor
|
|
||||||
int32_t len = 0;
|
|
||||||
for (int32_t i = 0; i < numOfOutput; ++i) {
|
|
||||||
len += pExpr[i].base.resSchema.bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
int32_t numOfCols = (pInfo->orderColumnList != NULL) ? (int32_t)taosArrayGetSize(pInfo->orderColumnList) : 0;
|
|
||||||
pInfo->prevRow = taosMemoryCalloc(1, (POINTER_BYTES * numOfCols + len));
|
|
||||||
|
|
||||||
int32_t offset = POINTER_BYTES * numOfCols;
|
|
||||||
for (int32_t i = 0; i < numOfCols; ++i) {
|
|
||||||
pInfo->prevRow[i] = (char*)pInfo->prevRow + offset;
|
|
||||||
|
|
||||||
SColIndex* index = taosArrayGet(pInfo->orderColumnList, i);
|
|
||||||
offset += pExpr[index->colIndex].base.resSchema.bytes;
|
|
||||||
}
|
|
||||||
|
|
||||||
// pInfo->pRes = createOutputBuf(pExpr, numOfOutput, pOperator->resultInfo.capacity);
|
|
||||||
|
|
||||||
pOperator->name = "SLimitOperator";
|
|
||||||
// pOperator->operatorType = OP_SLimit;
|
|
||||||
pOperator->blockingOptr = false;
|
|
||||||
pOperator->status = OP_NOT_OPENED;
|
|
||||||
// pOperator->exec = doSLimit;
|
|
||||||
pOperator->info = pInfo;
|
|
||||||
pOperator->pRuntimeEnv = pRuntimeEnv;
|
|
||||||
pOperator->closeFn = destroySlimitOperatorInfo;
|
|
||||||
|
|
||||||
int32_t code = appendDownstream(pOperator, &downstream, 1);
|
|
||||||
return pOperator;
|
|
||||||
}
|
|
||||||
|
|
||||||
static SSDataBlock* doTagScan(SOperatorInfo* pOperator, bool* newgroup) {
|
static SSDataBlock* doTagScan(SOperatorInfo* pOperator, bool* newgroup) {
|
||||||
#if 0
|
#if 0
|
||||||
SOperatorInfo* pOperator = (SOperatorInfo*) param;
|
SOperatorInfo* pOperator = (SOperatorInfo*) param;
|
||||||
|
@ -6594,7 +6521,6 @@ static SSDataBlock* doTagScan(SOperatorInfo* pOperator, bool* newgroup) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
STaskRuntimeEnv* pRuntimeEnv = pOperator->pRuntimeEnv;
|
|
||||||
int32_t maxNumOfTables = (int32_t)pResultInfo->capacity;
|
int32_t maxNumOfTables = (int32_t)pResultInfo->capacity;
|
||||||
|
|
||||||
STagScanInfo *pInfo = pOperator->info;
|
STagScanInfo *pInfo = pOperator->info;
|
||||||
|
@ -6726,7 +6652,6 @@ SOperatorInfo* createTagScanOperatorInfo(STaskRuntimeEnv* pRuntimeEnv, SExprInfo
|
||||||
size_t numOfGroup = GET_NUM_OF_TABLEGROUP(pRuntimeEnv);
|
size_t numOfGroup = GET_NUM_OF_TABLEGROUP(pRuntimeEnv);
|
||||||
assert(numOfGroup == 0 || numOfGroup == 1);
|
assert(numOfGroup == 0 || numOfGroup == 1);
|
||||||
|
|
||||||
pInfo->totalTables = pRuntimeEnv->tableqinfoGroupInfo.numOfTables;
|
|
||||||
pInfo->curPos = 0;
|
pInfo->curPos = 0;
|
||||||
|
|
||||||
SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo));
|
SOperatorInfo* pOperator = taosMemoryCalloc(1, sizeof(SOperatorInfo));
|
||||||
|
@ -6738,7 +6663,6 @@ SOperatorInfo* createTagScanOperatorInfo(STaskRuntimeEnv* pRuntimeEnv, SExprInfo
|
||||||
pOperator->getNextFn = doTagScan;
|
pOperator->getNextFn = doTagScan;
|
||||||
pOperator->pExpr = pExpr;
|
pOperator->pExpr = pExpr;
|
||||||
pOperator->numOfOutput = numOfOutput;
|
pOperator->numOfOutput = numOfOutput;
|
||||||
pOperator->pRuntimeEnv = pRuntimeEnv;
|
|
||||||
pOperator->closeFn = destroyTagScanOperatorInfo;
|
pOperator->closeFn = destroyTagScanOperatorInfo;
|
||||||
|
|
||||||
return pOperator;
|
return pOperator;
|
||||||
|
|
|
@ -267,6 +267,7 @@ int32_t tEncodeSMonDiskDesc(SCoder *encoder, const SMonDiskDesc *pDesc) {
|
||||||
if (tEncodeI64(encoder, pDesc->size.total) < 0) return -1;
|
if (tEncodeI64(encoder, pDesc->size.total) < 0) return -1;
|
||||||
if (tEncodeI64(encoder, pDesc->size.used) < 0) return -1;
|
if (tEncodeI64(encoder, pDesc->size.used) < 0) return -1;
|
||||||
if (tEncodeI64(encoder, pDesc->size.avail) < 0) return -1;
|
if (tEncodeI64(encoder, pDesc->size.avail) < 0) return -1;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t tDecodeSMonDiskDesc(SCoder *decoder, SMonDiskDesc *pDesc) {
|
static int32_t tDecodeSMonDiskDesc(SCoder *decoder, SMonDiskDesc *pDesc) {
|
||||||
|
|
|
@ -208,12 +208,15 @@ void MonitorTest::GetDiskInfo(SMonDiskInfo *pInfo) {
|
||||||
void MonitorTest::GetLogInfo(SMonLogs *logs) {
|
void MonitorTest::GetLogInfo(SMonLogs *logs) {
|
||||||
logs->logs = taosArrayInit(4, sizeof(SMonLogItem));
|
logs->logs = taosArrayInit(4, sizeof(SMonLogItem));
|
||||||
|
|
||||||
SMonLogItem item1 = {.level = DEBUG_INFO};
|
SMonLogItem item1 = {0};
|
||||||
|
item1.level = DEBUG_INFO;
|
||||||
|
|
||||||
item1.ts = taosGetTimestampMs();
|
item1.ts = taosGetTimestampMs();
|
||||||
strcpy(item1.content, "log test1");
|
strcpy(item1.content, "log test1");
|
||||||
taosArrayPush(logs->logs, &item1);
|
taosArrayPush(logs->logs, &item1);
|
||||||
|
|
||||||
SMonLogItem item2 = {.level = DEBUG_ERROR};
|
SMonLogItem item2 = {0};
|
||||||
|
item2.level = DEBUG_ERROR;
|
||||||
item2.ts = taosGetTimestampMs();
|
item2.ts = taosGetTimestampMs();
|
||||||
strcpy(item2.content, "log test2");
|
strcpy(item2.content, "log test2");
|
||||||
taosArrayPush(logs->logs, &item2);
|
taosArrayPush(logs->logs, &item2);
|
||||||
|
|
Loading…
Reference in New Issue