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

refact: data format

上级 ac27d62f
......@@ -41,8 +41,8 @@ int32_t tEncodeTSRow(SEncoder *pEncoder, const STSRow2 *pRow);
int32_t tDecodeTSRow(SDecoder *pDecoder, STSRow2 *pRow);
// STSchema
int32_t tTSchemaCreate(STSchema **ppTSchema);
int32_t tTSchemaDestroy(STSchema *pTSchema);
int32_t tTSchemaCreate(int32_t sver, SSchema *pSchema, int32_t ncols, STSchema **ppTSchema);
void tTSchemaDestroy(STSchema *pTSchema);
// STRUCT =================
struct STColumn {
......@@ -55,8 +55,8 @@ struct STColumn {
struct STSchema {
int32_t numOfCols;
schema_ver_t version;
uint16_t flen;
int32_t version;
int32_t flen;
int32_t vlen;
int32_t tlen;
STColumn columns[];
......
......@@ -43,6 +43,19 @@ int32_t tDecodeTSRow(SDecoder *pDecoder, STSRow2 *pRow) {
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 // ====================
static void dataColSetNEleNull(SDataCol *pCol, int nEle);
int tdAllocMemForCol(SDataCol *pCol, int maxPoints) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册