提交 741f8f7e 编写于 作者: D dapan1121

fix: remove filter ut

上级 362198ca
...@@ -89,6 +89,7 @@ void metaReaderClear(SMetaReader *pReader); ...@@ -89,6 +89,7 @@ void metaReaderClear(SMetaReader *pReader);
int32_t metaGetTableEntryByUid(SMetaReader *pReader, tb_uid_t uid); int32_t metaGetTableEntryByUid(SMetaReader *pReader, tb_uid_t uid);
int32_t metaReadNext(SMetaReader *pReader); int32_t metaReadNext(SMetaReader *pReader);
const void *metaGetTableTagVal(SMetaEntry *pEntry, int16_t type, STagVal *tagVal); const void *metaGetTableTagVal(SMetaEntry *pEntry, int16_t type, STagVal *tagVal);
int metaGetTableNameByUid(void* meta, uint64_t uid, char* tbName);
typedef struct SMetaFltParam { typedef struct SMetaFltParam {
tb_uid_t suid; tb_uid_t suid;
......
...@@ -98,6 +98,17 @@ tb_uid_t metaGetTableEntryUidByName(SMeta *pMeta, const char *name) { ...@@ -98,6 +98,17 @@ tb_uid_t metaGetTableEntryUidByName(SMeta *pMeta, const char *name) {
return uid; return uid;
} }
int metaGetTableNameByUid(void* meta, uint64_t uid, char* tbName) {
SMetaReader mr = {0};
metaReaderInit(&mr, (SMeta*)meta, 0);
metaGetTableEntryByUid(&mr, uid);
STR_TO_VARSTR(tbName, mr.me.name);
metaReaderClear(&mr);
return 0;
}
int metaReadNext(SMetaReader *pReader) { int metaReadNext(SMetaReader *pReader) {
SMeta *pMeta = pReader->pMeta; SMeta *pMeta = pReader->pMeta;
......
...@@ -13,4 +13,4 @@ target_link_libraries(scalar ...@@ -13,4 +13,4 @@ target_link_libraries(scalar
if(${BUILD_TEST}) if(${BUILD_TEST})
ADD_SUBDIRECTORY(test) ADD_SUBDIRECTORY(test)
endif(${BUILD_TEST}) endif(${BUILD_TEST})
\ No newline at end of file
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "tdatablock.h" #include "tdatablock.h"
#include "tjson.h" #include "tjson.h"
#include "ttime.h" #include "ttime.h"
#include "cJSON.h"
#include "vnode.h" #include "vnode.h"
typedef float (*_float_fn)(float); typedef float (*_float_fn)(float);
...@@ -1722,15 +1723,10 @@ int32_t winEndTsFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *p ...@@ -1722,15 +1723,10 @@ int32_t winEndTsFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *p
int32_t qTbnameFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) { int32_t qTbnameFunction(SScalarParam *pInput, int32_t inputNum, SScalarParam *pOutput) {
ASSERT(inputNum == 1); ASSERT(inputNum == 1);
SMetaReader mr = {0};
metaReaderInit(&mr, pInput->param, 0);
uint64_t uid = *(uint64_t *)colDataGetData(pInput->columnData, 0); uint64_t uid = *(uint64_t *)colDataGetData(pInput->columnData, 0);
metaGetTableEntryByUid(&mr, uid);
char str[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0}; char str[TSDB_TABLE_FNAME_LEN + VARSTR_HEADER_SIZE] = {0};
STR_TO_VARSTR(str, mr.me.name); metaGetTableNameByUid(pInput->param, uid, str);
metaReaderClear(&mr);
for(int32_t i = 0; i < pInput->numOfRows; ++i) { for(int32_t i = 0; i < pInput->numOfRows; ++i) {
colDataAppend(pOutput->columnData, pOutput->numOfRows + i, str, false); colDataAppend(pOutput->columnData, pOutput->numOfRows + i, str, false);
......
enable_testing() enable_testing()
add_subdirectory(filter) #add_subdirectory(filter)
add_subdirectory(scalar) add_subdirectory(scalar)
...@@ -9,7 +9,7 @@ IF(NOT TD_DARWIN) ...@@ -9,7 +9,7 @@ IF(NOT TD_DARWIN)
ADD_EXECUTABLE(filterTest ${SOURCE_LIST}) ADD_EXECUTABLE(filterTest ${SOURCE_LIST})
TARGET_LINK_LIBRARIES( TARGET_LINK_LIBRARIES(
filterTest filterTest
PUBLIC os util common gtest qcom function nodes scalar PUBLIC os util common gtest qcom function nodes scalar parser catalog transport
) )
TARGET_INCLUDE_DIRECTORIES( TARGET_INCLUDE_DIRECTORIES(
...@@ -17,4 +17,4 @@ IF(NOT TD_DARWIN) ...@@ -17,4 +17,4 @@ IF(NOT TD_DARWIN)
PUBLIC "${TD_SOURCE_DIR}/include/libs/scalar/" PUBLIC "${TD_SOURCE_DIR}/include/libs/scalar/"
PRIVATE "${TD_SOURCE_DIR}/source/libs/scalar/inc" PRIVATE "${TD_SOURCE_DIR}/source/libs/scalar/inc"
) )
ENDIF() ENDIF()
\ No newline at end of file
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include "scalar.h" #include "scalar.h"
#include "stub.h" #include "stub.h"
#include "taos.h" #include "taos.h"
#include "tdatablock.h"
#include "tdef.h" #include "tdef.h"
#include "tlog.h" #include "tlog.h"
#include "tvariant.h" #include "tvariant.h"
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册