refact: data format
This commit is contained in:
parent
ac27d62f33
commit
89e8f14a79
|
@ -41,8 +41,8 @@ int32_t tEncodeTSRow(SEncoder *pEncoder, const STSRow2 *pRow);
|
||||||
int32_t tDecodeTSRow(SDecoder *pDecoder, STSRow2 *pRow);
|
int32_t tDecodeTSRow(SDecoder *pDecoder, STSRow2 *pRow);
|
||||||
|
|
||||||
// STSchema
|
// STSchema
|
||||||
int32_t tTSchemaCreate(STSchema **ppTSchema);
|
int32_t tTSchemaCreate(int32_t sver, SSchema *pSchema, int32_t ncols, STSchema **ppTSchema);
|
||||||
int32_t tTSchemaDestroy(STSchema *pTSchema);
|
void tTSchemaDestroy(STSchema *pTSchema);
|
||||||
|
|
||||||
// STRUCT =================
|
// STRUCT =================
|
||||||
struct STColumn {
|
struct STColumn {
|
||||||
|
@ -54,12 +54,12 @@ struct STColumn {
|
||||||
};
|
};
|
||||||
|
|
||||||
struct STSchema {
|
struct STSchema {
|
||||||
int32_t numOfCols;
|
int32_t numOfCols;
|
||||||
schema_ver_t version;
|
int32_t version;
|
||||||
uint16_t flen;
|
int32_t flen;
|
||||||
int32_t vlen;
|
int32_t vlen;
|
||||||
int32_t tlen;
|
int32_t tlen;
|
||||||
STColumn columns[];
|
STColumn columns[];
|
||||||
};
|
};
|
||||||
|
|
||||||
struct STSRow2 {
|
struct STSRow2 {
|
||||||
|
|
|
@ -43,6 +43,19 @@ int32_t tDecodeTSRow(SDecoder *pDecoder, STSRow2 *pRow) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int32_t tTSchemaCreate(int32_t sver, SSchema *pSchema, int32_t ncols, STSchema **ppTSchema) {
|
||||||
|
*ppTSchema = (STSchema *)taosMemoryMalloc(sizeof(STSchema) + sizeof(STColumn) * ncols);
|
||||||
|
if (*ppTSchema == NULL) {
|
||||||
|
terrno = TSDB_CODE_OUT_OF_MEMORY;
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// (*ppTSchema)
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
void tTSchemaDestroy(STSchema *pTSchema) { taosMemoryFree(pTSchema); }
|
||||||
|
|
||||||
#if 1 // ====================
|
#if 1 // ====================
|
||||||
static void dataColSetNEleNull(SDataCol *pCol, int nEle);
|
static void dataColSetNEleNull(SDataCol *pCol, int nEle);
|
||||||
int tdAllocMemForCol(SDataCol *pCol, int maxPoints) {
|
int tdAllocMemForCol(SDataCol *pCol, int maxPoints) {
|
||||||
|
|
Loading…
Reference in New Issue