From 0f43e08f591d65812d38df9eeca994a41e751794 Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Sat, 23 May 2020 03:37:07 +0000 Subject: [PATCH] [TD-90]Tag Schema --- src/common/inc/tdataformat.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/common/inc/tdataformat.h b/src/common/inc/tdataformat.h index eef2e51cc2..30fb18bb95 100644 --- a/src/common/inc/tdataformat.h +++ b/src/common/inc/tdataformat.h @@ -208,7 +208,7 @@ void tdMergeTwoDataCols(SDataCols *target, SDataCols *src1, int *iter1, SD | ncols | colId1 | offset1 | colId2 | offset2 | ...| colIdN | offsetN | values | +----------+-------------------------------------------------------------+---------------------------------+ */ -typedef void *STagRowRaw; + #define TD_TAG_ROW_HEAD_SIZE sizeof(int16_t) @@ -221,20 +221,20 @@ typedef void *STagRowRaw; typedef struct { int16_t colId; // column ID - union{ - int64_t tagOffset; - int64_t tagValue; - }; + int16_t colLen; // if col type is binary/Nchar, this is the length of binary/Nchar + int64_t valueOrOffset; //to store value for numeric col or offset for binary/Nchar } STagCol; typedef struct { - int16_t nCols; // Total columns allocated - STagCol tagCols[]; + int32_t len; + void * pBinaryData; // Space to store the binary and Nchar value + int16_t ncols; // Total columns allocated + STagCol tagCols[]; } STagRow; - - - +int tdInsertTagCol(SDataRow *row, void *value, int32_t bytes, int16_t colId); +int tdQuerTagByID(SDataRow row, void *value, int16_t colId); +SDataRow tdNewTagRowFromSchema(STSchema *pSchema); #ifdef __cplusplus } -- GitLab