From 974bc4b7c656a1a1cf1e6c679b78288b3f2234bd Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Thu, 13 Oct 2022 21:49:53 +0800 Subject: [PATCH] add systable filterr --- source/libs/executor/src/executil.c | 10 ---------- source/libs/executor/src/scanoperator.c | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/source/libs/executor/src/executil.c b/source/libs/executor/src/executil.c index 2f6b737f79..95ee2e5f80 100644 --- a/source/libs/executor/src/executil.c +++ b/source/libs/executor/src/executil.c @@ -421,16 +421,6 @@ static SColumnInfoData* getColInfoResult(void* metaHandle, int64_t suid, SArray* goto end; } } - /*else { - code = metaGetTableTagsByUids(metaHandle, suid, uidList, tags); - if (code != 0) { - terrno = code; - qError("failed to get table from meta idx, reason: %s, suid:%" PRId64, tstrerror(code), suid); - goto end; - } else { - qInfo("succ to get table from meta idx, suid:%" PRId64, suid); - } - }*/ int32_t rows = taosArrayGetSize(uidList); if (rows == 0) { diff --git a/source/libs/executor/src/scanoperator.c b/source/libs/executor/src/scanoperator.c index 0cfdd2b68e..44c3cdd833 100644 --- a/source/libs/executor/src/scanoperator.c +++ b/source/libs/executor/src/scanoperator.c @@ -2724,9 +2724,28 @@ static int32_t sysTableUserTagsFillOneTableTags(const SSysTableScanInfo* pInfo, return TSDB_CODE_SUCCESS; } +static char* SYSTABLE_IDX_COLUMN[] = {"table_name", "db_name", "create_time", "columns", + "ttl", "stable_name", "vgroup_id', 'uid", "type"}; + +typedef int32_t (*__sys_filter)(void* pMeta, SNode* condition, SArray* result); + +typedef struct { + const char* name; + __sys_filter fltFunc; +} SSTabFltFuncDef; + +const SSTabFltFuncDef filterDict[] = { + {.name = "table_name", .fltFunc = NULL}, {.name = "db_name", .fltFunc = NULL}, + {.name = "create_time", .fltFunc = NULL}, {.name = "columns", .fltFunc = NULL}, + {.name = "ttl", .fltFunc = NULL}, {.name = "stable_name", .fltFunc = NULL}, + {.name = "vgroup_id", .fltFunc = NULL}, {.name = "uid", .fltFunc = NULL}, + {.name = "type", .fltFunc = NULL}}; + static SSDataBlock* sysTableScanUserTables(SOperatorInfo* pOperator) { SExecTaskInfo* pTaskInfo = pOperator->pTaskInfo; SSysTableScanInfo* pInfo = pOperator->info; + + SNode* pCondtion = pInfo->pCondition; if (pOperator->status == OP_EXEC_DONE) { return NULL; }