From a299c6769e34351697e1924255796b4b92335722 Mon Sep 17 00:00:00 2001 From: hzcheng Date: Mon, 6 Apr 2020 10:13:18 +0800 Subject: [PATCH] TD-100 --- src/common/inc/dataformat.h | 3 ++- src/common/src/dataformat.c | 9 ++++++++- src/os/linux/inc/os.h | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/common/inc/dataformat.h b/src/common/inc/dataformat.h index 4e8afd4f0e..04fa7dcc7d 100644 --- a/src/common/inc/dataformat.h +++ b/src/common/inc/dataformat.h @@ -110,7 +110,8 @@ typedef struct SDataCol { int bytes; int len; int offset; - void * pData; + void * pData; // Original data + void * pCData; // Compressed data } SDataCol; typedef struct { diff --git a/src/common/src/dataformat.c b/src/common/src/dataformat.c index 436426c86b..8d7a7cb1d0 100644 --- a/src/common/src/dataformat.c +++ b/src/common/src/dataformat.c @@ -317,14 +317,17 @@ void tdInitDataCols(SDataCols *pCols, STSchema *pSchema) { pCols->numOfCols = schemaNCols(pSchema); pCols->cols[0].pData = pCols->buf; + int offset = TD_DATA_ROW_HEAD_SIZE; for (int i = 0; i < schemaNCols(pSchema); i++) { if (i > 0) { pCols->cols[i].pData = (char *)(pCols->cols[i - 1].pData) + schemaColAt(pSchema, i - 1)->bytes * pCols->maxPoints; } pCols->cols[i].type = colType(schemaColAt(pSchema, i)); pCols->cols[i].bytes = colBytes(schemaColAt(pSchema, i)); - pCols->cols[i].offset = colOffset(schemaColAt(pSchema, i)); + pCols->cols[i].offset = offset; pCols->cols[i].colId = colColId(schemaColAt(pSchema, i)); + + offset += TYPE_BYTES[pCols->cols[i].type]; } } @@ -379,3 +382,7 @@ static int tdFLenFromSchema(STSchema *pSchema) { return ret; } + +int tdMergeDataCols(SDataCols *target, SDataCols *source) { + +} \ No newline at end of file diff --git a/src/os/linux/inc/os.h b/src/os/linux/inc/os.h index d3c401e3cf..ee75e1a079 100644 --- a/src/os/linux/inc/os.h +++ b/src/os/linux/inc/os.h @@ -205,6 +205,8 @@ ssize_t tsendfile(int dfd, int sfd, off_t *offset, size_t size); ssize_t twrite(int fd, void *buf, size_t n); +ssize_t tread(int fd, void *buf, size_t count); + bool taosCheckPthreadValid(pthread_t thread); void taosResetPthread(pthread_t *thread); -- GitLab