feat: add tdSRowSetTpInfo method
This commit is contained in:
parent
1c8910de73
commit
555caef50e
|
@ -181,7 +181,7 @@ typedef struct {
|
||||||
|
|
||||||
// N.B. If without STSchema, getExtendedRowSize() is used to get the rowMaxBytes and
|
// N.B. If without STSchema, getExtendedRowSize() is used to get the rowMaxBytes and
|
||||||
// (int32_t)ceil((double)nCols/TD_VTYPE_PARTS) should be added if TD_SUPPORT_BITMAP defined.
|
// (int32_t)ceil((double)nCols/TD_VTYPE_PARTS) should be added if TD_SUPPORT_BITMAP defined.
|
||||||
#define TD_ROW_MAX_BYTES_FROM_SCHEMA(s) (schemaTLen(s) + TD_ROW_HEAD_LEN)
|
#define TD_ROW_MAX_BYTES_FROM_SCHEMA(s) (schemaTLen(s) + TD_BITMAP_BYTES((s)->numOfCols) + TD_ROW_HEAD_LEN)
|
||||||
|
|
||||||
#define TD_ROW_SET_INFO(r, i) (TD_ROW_INFO(r) = (i))
|
#define TD_ROW_SET_INFO(r, i) (TD_ROW_INFO(r) = (i))
|
||||||
#define TD_ROW_SET_TYPE(r, t) (TD_ROW_TYPE(r) = (t))
|
#define TD_ROW_SET_TYPE(r, t) (TD_ROW_TYPE(r) = (t))
|
||||||
|
@ -593,6 +593,34 @@ static FORCE_INLINE int32_t tdSRowSetInfo(SRowBuilder *pBuilder, int32_t nCols,
|
||||||
return TSDB_CODE_SUCCESS;
|
return TSDB_CODE_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief
|
||||||
|
*
|
||||||
|
* @param pBuilder
|
||||||
|
* @param nCols
|
||||||
|
* @param nBoundCols use -1 if not available
|
||||||
|
* @param flen
|
||||||
|
* @return FORCE_INLINE
|
||||||
|
*/
|
||||||
|
static FORCE_INLINE int32_t tdSRowSetTpInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t flen) {
|
||||||
|
pBuilder->flen = flen;
|
||||||
|
pBuilder->nCols = nCols;
|
||||||
|
if (pBuilder->flen <= 0 || pBuilder->nCols <= 0) {
|
||||||
|
TASSERT(0);
|
||||||
|
terrno = TSDB_CODE_INVALID_PARA;
|
||||||
|
return terrno;
|
||||||
|
}
|
||||||
|
#ifdef TD_SUPPORT_BITMAP
|
||||||
|
// the primary TS key is stored separatedly
|
||||||
|
pBuilder->nBitmaps = (int16_t)TD_BITMAP_BYTES(pBuilder->nCols - 1);
|
||||||
|
#else
|
||||||
|
pBuilder->nBitmaps = 0;
|
||||||
|
pBuilder->nBoundBitmaps = 0;
|
||||||
|
#endif
|
||||||
|
return TSDB_CODE_SUCCESS;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief To judge row type: STpRow/SKvRow
|
* @brief To judge row type: STpRow/SKvRow
|
||||||
*
|
*
|
||||||
|
@ -1383,7 +1411,6 @@ static void tdSRowPrint(STSRow *row, STSchema *pSchema) {
|
||||||
}
|
}
|
||||||
printf("\n");
|
printf("\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef TROW_ORIGIN_HZ
|
#ifdef TROW_ORIGIN_HZ
|
||||||
typedef struct {
|
typedef struct {
|
||||||
uint32_t nRows;
|
uint32_t nRows;
|
||||||
|
|
Loading…
Reference in New Issue