未验证 提交 94ab465b 编写于 作者: D dapan1121 提交者: GitHub

Merge pull request #18621 from taosdata/fix/removeInvalidTab

fix: remove invalid table
...@@ -438,13 +438,12 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray* ...@@ -438,13 +438,12 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray*
goto end; goto end;
} }
} }
removeInvalidTable(uidList, tags);
int32_t rows = taosArrayGetSize(uidList); int32_t rows = taosArrayGetSize(uidList);
if (rows == 0) { if (rows == 0) {
goto end; goto end;
} }
// int64_t stt1 = taosGetTimestampUs();
// qDebug("generate tag meta rows:%d, cost:%ld us", rows, stt1-stt);
code = blockDataEnsureCapacity(pResBlock, rows); code = blockDataEnsureCapacity(pResBlock, rows);
if (code != TSDB_CODE_SUCCESS) { if (code != TSDB_CODE_SUCCESS) {
...@@ -452,7 +451,6 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray* ...@@ -452,7 +451,6 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray*
goto end; goto end;
} }
// int64_t st = taosGetTimestampUs();
for (int32_t i = 0; i < rows; i++) { for (int32_t i = 0; i < rows; i++) {
int64_t* uid = taosArrayGet(uidList, i); int64_t* uid = taosArrayGet(uidList, i);
for (int32_t j = 0; j < taosArrayGetSize(pResBlock->pDataBlock); j++) { for (int32_t j = 0; j < taosArrayGetSize(pResBlock->pDataBlock); j++) {
...@@ -467,7 +465,9 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray* ...@@ -467,7 +465,9 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray*
#endif #endif
} else { } else {
void* tag = taosHashGet(tags, uid, sizeof(int64_t)); void* tag = taosHashGet(tags, uid, sizeof(int64_t));
ASSERT(tag); if (tag == NULL) {
continue;
}
STagVal tagVal = {0}; STagVal tagVal = {0};
tagVal.cid = pColInfo->info.colId; tagVal.cid = pColInfo->info.colId;
const char* p = metaGetTableTagVal(tag, pColInfo->info.type, &tagVal); const char* p = metaGetTableTagVal(tag, pColInfo->info.type, &tagVal);
...@@ -923,14 +923,14 @@ static int32_t optimizeTbnameInCondImpl(void* metaHandle, int64_t suid, SArray* ...@@ -923,14 +923,14 @@ static int32_t optimizeTbnameInCondImpl(void* metaHandle, int64_t suid, SArray*
return -1; return -1;
} }
SArray* pTbList = getTableNameList(pList); SArray* pTbList = getTableNameList(pList);
int32_t numOfTables = taosArrayGetSize(pTbList); int32_t numOfTables = taosArrayGetSize(pTbList);
SHashObj *uHash = NULL; SHashObj* uHash = NULL;
size_t listlen = taosArrayGetSize(list); // len > 0 means there already have uids size_t listlen = taosArrayGetSize(list); // len > 0 means there already have uids
if (listlen > 0) { if (listlen > 0) {
uHash = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK); uHash = taosHashInit(32, taosGetDefaultHashFunction(TSDB_DATA_TYPE_BIGINT), false, HASH_NO_LOCK);
for (int i = 0; i < listlen; i++) { for (int i = 0; i < listlen; i++) {
int64_t *uid = taosArrayGet(list, i); int64_t* uid = taosArrayGet(list, i);
taosHashPut(uHash, uid, sizeof(int64_t), &i, sizeof(i)); taosHashPut(uHash, uid, sizeof(int64_t), &i, sizeof(i));
} }
} }
...@@ -2018,4 +2018,4 @@ void printDataBlock(SSDataBlock* pBlock, const char* flag) { ...@@ -2018,4 +2018,4 @@ void printDataBlock(SSDataBlock* pBlock, const char* flag) {
char* pBuf = NULL; char* pBuf = NULL;
qDebug("%s", dumpBlockData(pBlock, flag, &pBuf)); qDebug("%s", dumpBlockData(pBlock, flag, &pBuf));
taosMemoryFree(pBuf); taosMemoryFree(pBuf);
} }
\ No newline at end of file
...@@ -319,9 +319,9 @@ SArray* taosArrayDup(const SArray* pSrc, __array_item_dup_fn_t fn) { ...@@ -319,9 +319,9 @@ SArray* taosArrayDup(const SArray* pSrc, __array_item_dup_fn_t fn) {
} else { } else {
ASSERT(pSrc->elemSize == sizeof(void*)); ASSERT(pSrc->elemSize == sizeof(void*));
for(int32_t i = 0; i < pSrc->size; ++i) { for (int32_t i = 0; i < pSrc->size; ++i) {
void* p = fn(taosArrayGetP(pSrc, i)); void* p = fn(taosArrayGetP(pSrc, i));
memcpy(((char*)dst->pData )+ i * dst->elemSize, &p, dst->elemSize); memcpy(((char*)dst->pData) + i * dst->elemSize, &p, dst->elemSize);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册