refactor: dataColSetNEleNull should not be used by other modules and be set to static

This commit is contained in:
Liu Jicong 2021-08-09 14:20:36 +08:00
parent 1d3a2d47f1
commit 4521970f99
4 changed files with 2 additions and 12 deletions

View File

@ -330,7 +330,6 @@ int tdAllocMemForCol(SDataCol *pCol, int maxPoints);
void dataColInit(SDataCol *pDataCol, STColumn *pCol, int maxPoints);
int dataColAppendVal(SDataCol *pCol, const void *value, int numOfRows, int maxPoints);
void dataColSetOffset(SDataCol *pCol, int nEle);
void dataColSetNEleNull(SDataCol *pCol, int nEle);
bool isNEleNull(SDataCol *pCol, int nEle);

View File

@ -19,6 +19,7 @@
#include "wchar.h"
#include "tarray.h"
static void dataColSetNEleNull(SDataCol *pCol, int nEle);
static void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, int limit1, SDataCols *src2, int *iter2,
int limit2, int tRows, bool forceSetNull);
@ -297,7 +298,7 @@ static FORCE_INLINE void dataColSetNullAt(SDataCol *pCol, int index) {
}
}
void dataColSetNEleNull(SDataCol *pCol, int nEle) {
static void dataColSetNEleNull(SDataCol *pCol, int nEle) {
if (IS_VAR_DATA_TYPE(pCol->type)) {
pCol->len = 0;
for (int i = 0; i < nEle; i++) {

View File

@ -920,7 +920,6 @@ int tsdbWriteBlockImpl(STsdbRepo *pRepo, STable *pTable, SDFile *pDFile, SDataCo
SDataCol * pDataCol = pDataCols->cols + ncol;
SBlockCol *pBlockCol = pBlockData->cols + nColsNotAllNull;
// if (isNEleNull(pDataCol, rowsToWrite)) { // all data to commit are NULL, just ignore it
if (isAllRowsNull(pDataCol)) { // all data to commit are NULL, just ignore it
continue;
}

View File

@ -463,9 +463,6 @@ static int tsdbLoadBlockDataImpl(SReadH *pReadh, SBlock *pBlock, SDataCols *pDat
SDataCol *pDataCol = &(pDataCols->cols[dcol]);
if (dcol != 0 && ccol >= pBlockData->numOfCols) {
// Set current column as NULL and forward
// TODO: tdAllocMemForCol may fail
/*tdAllocMemForCol(pDataCol, pDataCols->maxPoints);*/
/*dataColSetNEleNull(pDataCol, pBlock->numOfRows);*/
dataColReset(pDataCol);
dcol++;
continue;
@ -506,9 +503,6 @@ static int tsdbLoadBlockDataImpl(SReadH *pReadh, SBlock *pBlock, SDataCols *pDat
ccol++;
} else {
// Set current column as NULL and forward
// TODO: tdAllocMemForCol may fail
/*tdAllocMemForCol(pDataCol, pDataCols->maxPoints);*/
/*dataColSetNEleNull(pDataCol, pBlock->numOfRows);*/
dataColReset(pDataCol);
dcol++;
}
@ -614,9 +608,6 @@ static int tsdbLoadBlockDataColsImpl(SReadH *pReadh, SBlock *pBlock, SDataCols *
}
if (pBlockCol == NULL) {
// TODO: tdAllocMemForCol may fail
/*tdAllocMemForCol(pDataCol, pDataCols->maxPoints);*/
/*dataColSetNEleNull(pDataCol, pBlock->numOfRows);*/
dataColReset(pDataCol);
continue;
}