feat: add tag condition
This commit is contained in:
parent
eea32f5f0a
commit
71ec636c3c
|
@ -103,7 +103,7 @@ tsdbReaderT tsdbQueryCacheLast(SVnode *pVnode, SQueryTableDataCond *pCond, STab
|
||||||
void *pMemRef);
|
void *pMemRef);
|
||||||
int32_t tsdbGetFileBlocksDistInfo(tsdbReaderT *pReader, STableBlockDistInfo *pTableBlockInfo);
|
int32_t tsdbGetFileBlocksDistInfo(tsdbReaderT *pReader, STableBlockDistInfo *pTableBlockInfo);
|
||||||
bool isTsdbCacheLastRow(tsdbReaderT *pReader);
|
bool isTsdbCacheLastRow(tsdbReaderT *pReader);
|
||||||
int32_t tsdbQueryAllTable(void* pMeta, uint64_t uid, STableGroupInfo* pGroupInfo, SNode* pTagCond);
|
int32_t tsdbGetAllTableList(SMeta* pMeta, uint64_t uid, SArray* list);
|
||||||
int64_t tsdbGetNumOfRowsInMemTable(tsdbReaderT *pHandle);
|
int64_t tsdbGetNumOfRowsInMemTable(tsdbReaderT *pHandle);
|
||||||
bool tsdbNextDataBlock(tsdbReaderT pTsdbReadHandle);
|
bool tsdbNextDataBlock(tsdbReaderT pTsdbReadHandle);
|
||||||
void tsdbRetrieveDataBlockInfo(tsdbReaderT *pTsdbReadHandle, SDataBlockInfo *pBlockInfo);
|
void tsdbRetrieveDataBlockInfo(tsdbReaderT *pTsdbReadHandle, SDataBlockInfo *pBlockInfo);
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "tsdb.h"
|
#include "tsdb.h"
|
||||||
#include "index.h"
|
|
||||||
|
|
||||||
#define EXTRA_BYTES 2
|
#define EXTRA_BYTES 2
|
||||||
#define ASCENDING_TRAVERSE(o) (o == TSDB_ORDER_ASC)
|
#define ASCENDING_TRAVERSE(o) (o == TSDB_ORDER_ASC)
|
||||||
|
@ -2804,7 +2803,7 @@ static int tsdbReadRowsFromCache(STableCheckInfo* pCheckInfo, TSKEY maxKey, int
|
||||||
return numOfRows;
|
return numOfRows;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int32_t getAllTableList(SMeta* pMeta, uint64_t uid, SArray* list) {
|
int32_t getAllTableList(SMeta* pMeta, uint64_t uid, SArray* list) {
|
||||||
SMCtbCursor* pCur = metaOpenCtbCursor(pMeta, uid);
|
SMCtbCursor* pCur = metaOpenCtbCursor(pMeta, uid);
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
|
|
|
@ -34,6 +34,7 @@
|
||||||
#include "thash.h"
|
#include "thash.h"
|
||||||
#include "ttypes.h"
|
#include "ttypes.h"
|
||||||
#include "vnode.h"
|
#include "vnode.h"
|
||||||
|
#include "index.h"
|
||||||
|
|
||||||
#define IS_MAIN_SCAN(runtime) ((runtime)->scanFlag == MAIN_SCAN)
|
#define IS_MAIN_SCAN(runtime) ((runtime)->scanFlag == MAIN_SCAN)
|
||||||
#define IS_REVERSE_SCAN(runtime) ((runtime)->scanFlag == REVERSE_SCAN)
|
#define IS_REVERSE_SCAN(runtime) ((runtime)->scanFlag == REVERSE_SCAN)
|
||||||
|
@ -4894,9 +4895,23 @@ SArray* extractColMatchInfo(SNodeList* pNodeList, SDataBlockDescNode* pOutputNod
|
||||||
|
|
||||||
int32_t doCreateTableGroup(void* metaHandle, int32_t tableType, uint64_t tableUid, STableGroupInfo* pGroupInfo,
|
int32_t doCreateTableGroup(void* metaHandle, int32_t tableType, uint64_t tableUid, STableGroupInfo* pGroupInfo,
|
||||||
uint64_t queryId, uint64_t taskId, SNode* pTagCond) {
|
uint64_t queryId, uint64_t taskId, SNode* pTagCond) {
|
||||||
int32_t code = 0;
|
int32_t code = TSDB_CODE_SUCCESS;
|
||||||
if (tableType == TSDB_SUPER_TABLE) {
|
if (tableType == TSDB_SUPER_TABLE) {
|
||||||
code = tsdbQueryAllTable(metaHandle, tableUid, pGroupInfo, pTagCond);
|
SArray* res = taosArrayInit(8, sizeof(STableKeyInfo));
|
||||||
|
|
||||||
|
int32_t ret = ;
|
||||||
|
if(pTagCond){
|
||||||
|
code = doFilterTag(pTagCond, res);
|
||||||
|
}else{
|
||||||
|
code = tsdbGetAllTableList(metaHandle, tableUid, res);
|
||||||
|
}
|
||||||
|
if (code != TSDB_CODE_SUCCESS) {
|
||||||
|
return code;
|
||||||
|
}
|
||||||
|
|
||||||
|
pGroupInfo->numOfTables = (uint32_t)taosArrayGetSize(res);
|
||||||
|
pGroupInfo->pGroupList = taosArrayInit(1, POINTER_BYTES);
|
||||||
|
taosArrayPush(pGroupInfo->pGroupList, &res);
|
||||||
} else { // Create one table group.
|
} else { // Create one table group.
|
||||||
code = tsdbGetOneTableGroup(metaHandle, tableUid, 0, pGroupInfo);
|
code = tsdbGetOneTableGroup(metaHandle, tableUid, 0, pGroupInfo);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue