Merge remote-tracking branch 'origin/refact/fillhistory' into refact/fillhistory

# Conflicts:
#	source/dnode/vnode/inc/vnode.h
#	source/libs/executor/src/executil.c
#	source/libs/index/CMakeLists.txt
#	source/libs/index/src/indexFilter.c
This commit is contained in:
Haojun Liao 2023-05-23 18:32:47 +08:00
commit 3d084adf1f
7 changed files with 49 additions and 30 deletions

View File

@ -213,6 +213,7 @@ typedef struct SIndexMetaArg {
void* idx;
void* ivtIdx;
uint64_t suid;
int (*metaFilterFunc)(void* metaEx, void* param, SArray* result);
} SIndexMetaArg;
typedef enum { SFLT_NOT_INDEX, SFLT_COARSE_INDEX, SFLT_ACCURATE_INDEX } SIdxFltStatus;

View File

@ -55,6 +55,16 @@ extern bool filterRangeExecute(SFilterInfo *info, SColumnDataAgg **pColsAgg,
int32_t filterPartitionCond(SNode **pCondition, SNode **pPrimaryKeyCond, SNode **pTagIndexCond, SNode **pTagCond,
SNode **pOtherCond);
typedef struct SMetaFltParam {
tb_uid_t suid;
int16_t cid;
int16_t type;
void *val;
bool reverse;
bool equal;
int (*filterFunc)(void *a, void *b, int16_t type);
} SMetaFltParam;
#ifdef __cplusplus
}
#endif

View File

@ -26,6 +26,7 @@
#include "tfs.h"
#include "wal.h"
#include "filter.h"
#include "tcommon.h"
#include "tfs.h"
#include "tgrant.h"
@ -184,7 +185,8 @@ typedef struct STsdbReader STsdbReader;
#define CACHESCAN_RETRIEVE_LAST 0x8
int32_t tsdbReaderOpen(SVnode *pVnode, SQueryTableDataCond *pCond, void *pTableList, int32_t numOfTables,
SSDataBlock *pResBlock, STsdbReader **ppReader, const char *idstr, bool countOnly, SHashObj** pIgnoreTables);
SSDataBlock *pResBlock, STsdbReader **ppReader, const char *idstr, bool countOnly,
SHashObj **pIgnoreTables);
int32_t tsdbSetTableList(STsdbReader *pReader, const void *pTableList, int32_t num);
void tsdbReaderSetId(STsdbReader *pReader, const char *idstr);
void tsdbReaderClose(STsdbReader *pReader);

View File

@ -1083,7 +1083,9 @@ typedef struct {
int32_t vLen;
} SIdxCursor;
int32_t metaFilterCreateTime(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
int32_t metaFilterCreateTime(void *meta, void *arg, SArray *pUids) {
SMeta *pMeta = meta;
SMetaFltParam *param = arg;
int32_t ret = 0;
SIdxCursor *pCursor = NULL;
@ -1141,7 +1143,9 @@ END:
return ret;
}
int32_t metaFilterTableName(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
int32_t metaFilterTableName(void *meta, void *arg, SArray *pUids) {
SMeta *pMeta = meta;
SMetaFltParam *param = arg;
int32_t ret = 0;
char *buf = NULL;
@ -1206,7 +1210,9 @@ END:
return ret;
}
int32_t metaFilterTtl(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
int32_t metaFilterTtl(void *meta, void *arg, SArray *pUids) {
SMeta *pMeta = meta;
SMetaFltParam *param = arg;
int32_t ret = 0;
char *buf = NULL;
@ -1235,7 +1241,10 @@ END:
// impl later
return 0;
}
int32_t metaFilterTableIds(SMeta *pMeta, SMetaFltParam *param, SArray *pUids) {
int32_t metaFilterTableIds(void *meta, void *arg, SArray *pUids) {
SMeta *pMeta = meta;
SMetaFltParam *param = arg;
SMetaEntry oStbEntry = {0};
int32_t ret = -1;
char *buf = NULL;

View File

@ -436,7 +436,6 @@ static void genTagFilterDigest(const SNode* pTagCond, T_MD5_CTX* pContext) {
taosMemoryFree(payload);
}
static void genTbGroupDigest(const SNode* pGroup, uint8_t* filterDigest, T_MD5_CTX* pContext) {
char* payload = NULL;
int32_t len = 0;
@ -500,7 +499,8 @@ int32_t getColInfoResultForGroupby(void* pVnode, SNodeList* group, STableListInf
if (tableList) {
taosArrayDestroy(pTableListInfo->pTableList);
pTableListInfo->pTableList = tableList;
qDebug("retrieve tb group list from cache, numOfTables:%d", (int32_t)taosArrayGetSize(pTableListInfo->pTableList));
qDebug("retrieve tb group list from cache, numOfTables:%d",
(int32_t)taosArrayGetSize(pTableListInfo->pTableList));
goto end;
}
}
@ -839,7 +839,6 @@ static int32_t optimizeTbnameInCondImpl(void* pVnode, SArray* pExistedUidList, S
return -1;
}
static SSDataBlock* createTagValBlockForFilter(SArray* pColList, int32_t numOfTables, SArray* pUidTagList,
void* pVnode, SStorageAPI* pStorageAPI) {
SSDataBlock* pResBlock = createDataBlock();
@ -1845,9 +1844,7 @@ uint64_t tableListGetSize(const STableListInfo* pTableList) {
return taosArrayGetSize(pTableList->pTableList);
}
uint64_t tableListGetSuid(const STableListInfo* pTableList) {
return pTableList->idInfo.suid;
}
uint64_t tableListGetSuid(const STableListInfo* pTableList) { return pTableList->idInfo.suid; }
STableKeyInfo* tableListGetInfo(const STableListInfo* pTableList, int32_t index) {
if (taosArrayGetSize(pTableList->pTableList) == 0) {

View File

@ -12,7 +12,6 @@ target_link_libraries(
PUBLIC os
PUBLIC util
PUBLIC common
# PUBLIC vnode
PUBLIC nodes
PUBLIC scalar
PUBLIC function

View File

@ -13,6 +13,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "filter.h"
#include "index.h"
#include "indexComm.h"
#include "indexInt.h"