提交 89e8f14a 编写于 作者: H Hongze Cheng

refact: data format

上级 ac27d62f
...@@ -41,8 +41,8 @@ int32_t tEncodeTSRow(SEncoder *pEncoder, const STSRow2 *pRow); ...@@ -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 { ...@@ -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) { ...@@ -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) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册