refactor: dataColSetNEleNull should not be used by other modules and be set to static
This commit is contained in:
parent
1d3a2d47f1
commit
4521970f99
|
@ -330,7 +330,6 @@ int tdAllocMemForCol(SDataCol *pCol, int maxPoints);
|
||||||
void dataColInit(SDataCol *pDataCol, STColumn *pCol, int maxPoints);
|
void dataColInit(SDataCol *pDataCol, STColumn *pCol, int maxPoints);
|
||||||
int dataColAppendVal(SDataCol *pCol, const void *value, int numOfRows, int maxPoints);
|
int dataColAppendVal(SDataCol *pCol, const void *value, int numOfRows, int maxPoints);
|
||||||
void dataColSetOffset(SDataCol *pCol, int nEle);
|
void dataColSetOffset(SDataCol *pCol, int nEle);
|
||||||
void dataColSetNEleNull(SDataCol *pCol, int nEle);
|
|
||||||
|
|
||||||
bool isNEleNull(SDataCol *pCol, int nEle);
|
bool isNEleNull(SDataCol *pCol, int nEle);
|
||||||
|
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
#include "wchar.h"
|
#include "wchar.h"
|
||||||
#include "tarray.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,
|
static void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, int limit1, SDataCols *src2, int *iter2,
|
||||||
int limit2, int tRows, bool forceSetNull);
|
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)) {
|
if (IS_VAR_DATA_TYPE(pCol->type)) {
|
||||||
pCol->len = 0;
|
pCol->len = 0;
|
||||||
for (int i = 0; i < nEle; i++) {
|
for (int i = 0; i < nEle; i++) {
|
||||||
|
|
|
@ -920,7 +920,6 @@ int tsdbWriteBlockImpl(STsdbRepo *pRepo, STable *pTable, SDFile *pDFile, SDataCo
|
||||||
SDataCol * pDataCol = pDataCols->cols + ncol;
|
SDataCol * pDataCol = pDataCols->cols + ncol;
|
||||||
SBlockCol *pBlockCol = pBlockData->cols + nColsNotAllNull;
|
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
|
if (isAllRowsNull(pDataCol)) { // all data to commit are NULL, just ignore it
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -463,9 +463,6 @@ static int tsdbLoadBlockDataImpl(SReadH *pReadh, SBlock *pBlock, SDataCols *pDat
|
||||||
SDataCol *pDataCol = &(pDataCols->cols[dcol]);
|
SDataCol *pDataCol = &(pDataCols->cols[dcol]);
|
||||||
if (dcol != 0 && ccol >= pBlockData->numOfCols) {
|
if (dcol != 0 && ccol >= pBlockData->numOfCols) {
|
||||||
// Set current column as NULL and forward
|
// Set current column as NULL and forward
|
||||||
// TODO: tdAllocMemForCol may fail
|
|
||||||
/*tdAllocMemForCol(pDataCol, pDataCols->maxPoints);*/
|
|
||||||
/*dataColSetNEleNull(pDataCol, pBlock->numOfRows);*/
|
|
||||||
dataColReset(pDataCol);
|
dataColReset(pDataCol);
|
||||||
dcol++;
|
dcol++;
|
||||||
continue;
|
continue;
|
||||||
|
@ -506,9 +503,6 @@ static int tsdbLoadBlockDataImpl(SReadH *pReadh, SBlock *pBlock, SDataCols *pDat
|
||||||
ccol++;
|
ccol++;
|
||||||
} else {
|
} else {
|
||||||
// Set current column as NULL and forward
|
// Set current column as NULL and forward
|
||||||
// TODO: tdAllocMemForCol may fail
|
|
||||||
/*tdAllocMemForCol(pDataCol, pDataCols->maxPoints);*/
|
|
||||||
/*dataColSetNEleNull(pDataCol, pBlock->numOfRows);*/
|
|
||||||
dataColReset(pDataCol);
|
dataColReset(pDataCol);
|
||||||
dcol++;
|
dcol++;
|
||||||
}
|
}
|
||||||
|
@ -614,9 +608,6 @@ static int tsdbLoadBlockDataColsImpl(SReadH *pReadh, SBlock *pBlock, SDataCols *
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pBlockCol == NULL) {
|
if (pBlockCol == NULL) {
|
||||||
// TODO: tdAllocMemForCol may fail
|
|
||||||
/*tdAllocMemForCol(pDataCol, pDataCols->maxPoints);*/
|
|
||||||
/*dataColSetNEleNull(pDataCol, pBlock->numOfRows);*/
|
|
||||||
dataColReset(pDataCol);
|
dataColReset(pDataCol);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue