提交 abfa8c1d 编写于 作者: H Haojun Liao

fix(query): add api to memset buffer for filtering data.

上级 03154146
......@@ -217,6 +217,8 @@ int32_t blockDataSort_rv(SSDataBlock* pDataBlock, SArray* pOrderInfo, bool nullF
int32_t colInfoDataEnsureCapacity(SColumnInfoData* pColumn, uint32_t numOfRows);
int32_t blockDataEnsureCapacity(SSDataBlock* pDataBlock, uint32_t numOfRows);
void colInfoDataMemset(SColumnInfoData* pColumn, uint32_t numOfRows);
void colInfoDataCleanup(SColumnInfoData* pColumn, uint32_t numOfRows);
void blockDataCleanup(SSDataBlock* pDataBlock);
......
......@@ -60,6 +60,6 @@ target_link_libraries(
PRIVATE os util common transport nodes parser command planner catalog scheduler function qcom
)
if(${BUILD_TEST})
#if(${BUILD_TEST})
ADD_SUBDIRECTORY(test)
endif(${BUILD_TEST})
\ No newline at end of file
#endif(${BUILD_TEST})
\ No newline at end of file
......@@ -112,7 +112,7 @@ void createNewTable(TAOS* pConn, int32_t index) {
}
taos_free_result(pRes);
for(int32_t i = 0; i < 10000; i += 20) {
for(int32_t i = 0; i < 20; i += 20) {
char sql[1024] = {0};
sprintf(sql,
"insert into tu%d values(now+%da, %d)(now+%da, %d)(now+%da, %d)(now+%da, %d)"
......@@ -692,6 +692,7 @@ TEST(testCase, insert_test) {
taos_free_result(pRes);
taos_close(pConn);
}
#endif
TEST(testCase, projection_query_tables) {
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
......@@ -703,7 +704,7 @@ TEST(testCase, projection_query_tables) {
// }
// taos_free_result(pRes);
TAOS_RES* pRes = taos_query(pConn, "use benchmarkcpu");
TAOS_RES* pRes = taos_query(pConn, "use abc2");
taos_free_result(pRes);
pRes = taos_query(pConn, "create stable st1 (ts timestamp, k int) tags(a int)");
......@@ -725,7 +726,7 @@ TEST(testCase, projection_query_tables) {
}
taos_free_result(pRes);
for (int32_t i = 0; i < 2; ++i) {
for (int32_t i = 0; i < 200000; ++i) {
printf("create table :%d\n", i);
createNewTable(pConn, i);
}
......@@ -750,7 +751,9 @@ TEST(testCase, projection_query_tables) {
taos_free_result(pRes);
taos_close(pConn);
}
#endif
#if 0
TEST(testCase, tsbs_perf_test) {
TdThread qid[20] = {0};
......@@ -761,7 +764,7 @@ TEST(testCase, tsbs_perf_test) {
getchar();
}
#if 0
TEST(testCase, projection_query_stables) {
TAOS* pConn = taos_connect("localhost", "root", "taosdata", NULL, 0);
ASSERT_NE(pConn, nullptr);
......
......@@ -1208,6 +1208,16 @@ int32_t colInfoDataEnsureCapacity(SColumnInfoData* pColumn, uint32_t numOfRows)
return doEnsureCapacity(pColumn, &info, numOfRows);
}
void colInfoDataMemset(SColumnInfoData* pColumn, uint32_t numOfRows) {
if (!IS_VAR_DATA_TYPE(pColumn->info.type)) {
memset(pColumn->pData, 0, pColumn->info.bytes * numOfRows);
} else {
if (pColumn->varmeta.length > 0) {
memset(pColumn->pData, 0, pColumn->varmeta.length);
}
}
}
int32_t blockDataEnsureCapacity(SSDataBlock* pDataBlock, uint32_t numOfRows) {
int32_t code = 0;
if (numOfRows == 0) {
......
......@@ -56,6 +56,7 @@ int32_t sclCreateColumnInfoData(SDataType *pType, int32_t numOfRows, SScalarPara
return terrno;
}
colInfoDataMemset(pColumnData, numOfRows);
pParam->columnData = pColumnData;
pParam->colAlloced = true;
return TSDB_CODE_SUCCESS;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册