Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
d6f02761
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1187
Star
22018
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
d6f02761
编写于
5月 31, 2022
作者:
H
Hongze Cheng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
more refact
上级
010f1d2e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
23 addition
and
8 deletion
+23
-8
include/common/tdataformat.h
include/common/tdataformat.h
+12
-7
source/common/src/tdataformat.c
source/common/src/tdataformat.c
+11
-1
未找到文件。
include/common/tdataformat.h
浏览文件 @
d6f02761
...
...
@@ -42,11 +42,13 @@ int32_t tTSchemaCreate(int32_t sver, SSchema *pSchema, int32_t nCols, STSchema *
void
tTSchemaDestroy
(
STSchema
*
pTSchema
);
// SColVal
#define ColValNONE ((SColVal){.type = COL_VAL_NONE, .nData = 0, .pData = NULL})
#define ColValNULL ((SColVal){.type = COL_VAL_NULL, .nData = 0, .pData = NULL})
#define ColValDATA(nData, pData) ((SColVal){.type = COL_VAL_DATA, .nData = (nData), .pData = (pData)})
//
#define ColValNONE ((SColVal){.type = COL_VAL_NONE, .nData = 0, .pData = NULL})
//
#define ColValNULL ((SColVal){.type = COL_VAL_NULL, .nData = 0, .pData = NULL})
//
#define ColValDATA(nData, pData) ((SColVal){.type = COL_VAL_DATA, .nData = (nData), .pData = (pData)})
// STSRow2
int32_t
tTSRowNew
(
SArray
*
pArray
,
STSchema
*
pTSchema
,
STSRow2
**
ppRow
);
int32_t
tPutTSRow
(
uint8_t
*
p
,
STSRow2
*
pRow
);
int32_t
tGetTSRow
(
uint8_t
*
p
,
STSRow2
*
pRow
);
int32_t
tTSRowDup
(
const
STSRow2
*
pRow
,
STSRow2
**
ppRow
);
...
...
@@ -54,11 +56,13 @@ void tTSRowFree(STSRow2 *pRow);
int32_t
tTSRowGet
(
const
STSRow2
*
pRow
,
STSchema
*
pTSchema
,
int32_t
iCol
,
SColVal
*
pColVal
);
// STSRowBuilder
#if 0
int32_t tTSRowBuilderInit(STSRowBuilder *pBuilder, int32_t sver, int32_t nCols, SSchema *pSchema);
void tTSRowBuilderClear(STSRowBuilder *pBuilder);
void tTSRowBuilderReset(STSRowBuilder *pBuilder);
int32_t tTSRowBuilderPut(STSRowBuilder *pBuilder, int32_t cid, uint8_t *pData, uint32_t nData);
int32_t tTSRowBuilderGetRow(STSRowBuilder *pBuilder, const STSRow2 **ppRow);
#endif
// STagVal
static
FORCE_INLINE
void
tTagValPush
(
SArray
*
pTagArray
,
void
*
key
,
int8_t
type
,
uint8_t
*
pData
,
uint32_t
nData
,
...
...
@@ -137,11 +141,12 @@ struct SValue {
};
};
typedef
enum
{
COL_VAL_NONE
=
0
,
COL_VAL_NULL
=
1
,
COL_VAL_DATA
=
2
}
EColValT
;
struct
SColVal
{
EColValT
type
;
uint32_t
nData
;
uint8_t
*
pData
;
int8_t
isNone
;
int8_t
isNull
;
int8_t
type
;
int16_t
cid
;
SValue
value
;
};
struct
STagVal
{
...
...
source/common/src/tdataformat.c
浏览文件 @
d6f02761
...
...
@@ -146,7 +146,13 @@ static int32_t tGetSValue(uint8_t *p, SValue *pValue, int8_t type) {
return
n
;
}
// STSRow2
// STSRow2 ========================================================================
int32_t
tTSRowNew
(
SArray
*
pArray
,
STSchema
*
pTSchema
,
STSRow2
**
ppRow
)
{
int32_t
code
=
0
;
// TODO
return
code
;
}
int32_t
tPutTSRow
(
uint8_t
*
p
,
STSRow2
*
pRow
)
{
int32_t
n
=
0
;
...
...
@@ -215,6 +221,7 @@ void tTSRowFree(STSRow2 *pRow) {
}
int32_t
tTSRowGet
(
const
STSRow2
*
pRow
,
STSchema
*
pTSchema
,
int32_t
iCol
,
SColVal
*
pColVal
)
{
#if 0
uint32_t n;
uint8_t *p;
uint8_t v;
...
...
@@ -310,6 +317,7 @@ int32_t tTSRowGet(const STSRow2 *pRow, STSchema *pTSchema, int32_t iCol, SColVal
}
}
#endif
return
0
;
}
...
...
@@ -354,6 +362,7 @@ void tTSchemaDestroy(STSchema *pTSchema) {
}
// STSRowBuilder
#if 0
int32_t tTSRowBuilderInit(STSRowBuilder *pBuilder, int32_t sver, int32_t nCols, SSchema *pSchema) {
if (tTSchemaCreate(sver, pSchema, nCols, &pBuilder->pTSchema) < 0) return -1;
...
...
@@ -612,6 +621,7 @@ int32_t tTSRowBuilderGetRow(STSRowBuilder *pBuilder, const STSRow2 **ppRow) {
return 0;
}
#endif
static
int
tTagValCmprFn
(
const
void
*
p1
,
const
void
*
p2
)
{
if
(((
STagVal
*
)
p1
)
->
cid
<
((
STagVal
*
)
p2
)
->
cid
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录