Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
2fbc6a53
T
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
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看板
提交
2fbc6a53
编写于
7月 06, 2022
作者:
C
Cary Xu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
other: enable kv row
上级
4a3ee65e
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
20 addition
and
8 deletion
+20
-8
include/common/trow.h
include/common/trow.h
+1
-1
source/common/src/trow.c
source/common/src/trow.c
+19
-7
未找到文件。
include/common/trow.h
浏览文件 @
2fbc6a53
...
...
@@ -322,7 +322,7 @@ STSRow *mergeTwoRows(void *buffer, STSRow *row1, STSRow *row2, STSchema *pSchema
int32_t
tdGetColDataOfRow
(
SCellVal
*
pVal
,
SDataCol
*
pCol
,
int32_t
row
,
int8_t
bitmapMode
);
bool
tdSTpRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
col_type_t
colType
,
int32_t
flen
,
uint32_t
offset
,
col_id_t
colIdx
,
SCellVal
*
pVal
);
bool
tdSKvRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
uint32_t
offset
,
col_id_t
colIdx
,
SCellVal
*
pVal
);
bool
tdSKvRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
col_id_t
colIdx
,
SCellVal
*
pVal
);
int32_t
dataColGetNEleLen
(
SDataCol
*
pDataCol
,
int32_t
rows
,
int8_t
bitmapMode
);
void
tdSCellValPrint
(
SCellVal
*
pVal
,
int8_t
colType
);
void
tdSRowPrint
(
STSRow
*
row
,
STSchema
*
pSchema
,
const
char
*
tag
);
...
...
source/common/src/trow.c
浏览文件 @
2fbc6a53
...
...
@@ -34,6 +34,7 @@ const uint8_t tdVTypeByte[2][3] = {{
// declaration
static
uint8_t
tdGetBitmapByte
(
uint8_t
byte
);
static
int32_t
tdCompareColId
(
const
void
*
arg1
,
const
void
*
arg2
);
static
FORCE_INLINE
int32_t
compareKvRowColId
(
const
void
*
key1
,
const
void
*
key2
);
// static void dataColSetNEleNull(SDataCol *pCol, int nEle);
...
...
@@ -1045,13 +1046,28 @@ int32_t dataColGetNEleLen(SDataCol *pDataCol, int32_t rows, int8_t bitmapMode) {
return
result
;
}
bool
tdSKvRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
uint32_t
offset
,
col_id_t
colIdx
,
SCellVal
*
pVal
)
{
bool
tdSKvRowGetVal
(
STSRow
*
pRow
,
col_id_t
colId
,
col_id_t
colIdx
,
SCellVal
*
pVal
)
{
if
(
colId
==
PRIMARYKEY_TIMESTAMP_COL_ID
)
{
tdRowSetVal
(
pVal
,
TD_VTYPE_NORM
,
TD_ROW_KEY_ADDR
(
pRow
));
return
true
;
}
int16_t
nCols
=
tdRowGetNCols
(
pRow
)
-
1
;
if
(
nCols
<=
0
)
{
pVal
->
valType
=
TD_VTYPE_NONE
;
return
true
;
}
SKvRowIdx
*
pColIdx
=
(
SKvRowIdx
*
)
taosbsearch
(
&
colId
,
TD_ROW_COL_IDX
(
pRow
),
nCols
,
sizeof
(
SKvRowIdx
),
compareKvRowColId
,
TD_EQ
);
if
(
!
pColIdx
)
{
pVal
->
valType
=
TD_VTYPE_NONE
;
return
true
;
}
void
*
pBitmap
=
tdGetBitmapAddrKv
(
pRow
,
tdRowGetNCols
(
pRow
));
tdGetKvRowValOfCol
(
pVal
,
pRow
,
pBitmap
,
offset
,
colIdx
);
tdGetKvRowValOfCol
(
pVal
,
pRow
,
pBitmap
,
pColIdx
->
offset
,
POINTER_DISTANCE
(
pColIdx
,
TD_ROW_COL_IDX
(
pRow
))
/
sizeof
(
SKvRowIdx
));
return
true
;
}
...
...
@@ -1687,7 +1703,6 @@ int32_t tdAppendColValToTpRow(SRowBuilder *pBuilder, TDRowValT valType, const vo
int32_t
tdSRowSetExtendedInfo
(
SRowBuilder
*
pBuilder
,
int32_t
nCols
,
int32_t
nBoundCols
,
int32_t
flen
,
int32_t
allNullLen
,
int32_t
boundNullLen
)
{
#if 0
if
((
boundNullLen
>
0
)
&&
(
allNullLen
>
0
)
&&
(
nBoundCols
>
0
))
{
uint32_t
tpLen
=
allNullLen
;
uint32_t
kvLen
=
sizeof
(
col_id_t
)
+
sizeof
(
SKvRowIdx
)
*
nBoundCols
+
boundNullLen
;
...
...
@@ -1700,8 +1715,6 @@ int32_t tdSRowSetExtendedInfo(SRowBuilder *pBuilder, int32_t nCols, int32_t nBou
}
else
{
pBuilder
->
rowType
=
TD_ROW_TP
;
}
#endif
pBuilder
->
rowType
=
TD_ROW_TP
;
pBuilder
->
flen
=
flen
;
pBuilder
->
nCols
=
nCols
;
pBuilder
->
nBoundCols
=
nBoundCols
;
...
...
@@ -1976,8 +1989,7 @@ void tTSRowGetVal(STSRow *pRow, STSchema *pTSchema, int16_t iCol, SColVal *pColV
tdSTpRowGetVal
(
pRow
,
pTColumn
->
colId
,
pTColumn
->
type
,
pTSchema
->
flen
,
pTColumn
->
offset
,
iCol
-
1
,
&
cv
);
}
else
if
(
TD_IS_KV_ROW
(
pRow
))
{
ASSERT
(
iCol
>
0
);
SKvRowIdx
*
pColIdx
=
tdKvRowColIdxAt
(
pRow
,
iCol
-
1
);
tdSKvRowGetVal
(
pRow
,
pTColumn
->
colId
,
pColIdx
->
offset
,
iCol
-
1
,
&
cv
);
tdSKvRowGetVal
(
pRow
,
pTColumn
->
colId
,
iCol
-
1
,
&
cv
);
}
else
{
ASSERT
(
0
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录