Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
200a6695
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看板
提交
200a6695
编写于
8月 08, 2022
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: do some internal refactor.
上级
ab624de7
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
36 addition
and
16 deletion
+36
-16
include/common/tmsg.h
include/common/tmsg.h
+3
-3
source/client/src/clientImpl.c
source/client/src/clientImpl.c
+5
-1
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+23
-11
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+5
-1
未找到文件。
include/common/tmsg.h
浏览文件 @
200a6695
...
...
@@ -296,13 +296,13 @@ void tFreeSSubmitRsp(SSubmitRsp* pRsp);
#define COL_IDX_ON ((int8_t)0x2)
#define COL_SET_NULL ((int8_t)0x10)
#define COL_SET_VAL ((int8_t)0x20)
typedef
struct
SSchema
{
struct
SSchema
{
int8_t
type
;
int8_t
flags
;
col_id_t
colId
;
int32_t
bytes
;
char
name
[
TSDB_COL_NAME_LEN
];
}
SSchema
;
};
#define COL_IS_SET(FLG) (((FLG) & (COL_SET_VAL | COL_SET_NULL)) != 0)
#define COL_CLR_SET(FLG) ((FLG) &= (~(COL_SET_VAL | COL_SET_NULL)))
...
...
@@ -648,7 +648,7 @@ typedef struct {
};
bool
output
;
// TODO remove it later
int
16_t
type
;
int
8_t
type
;
int32_t
bytes
;
uint8_t
precision
;
uint8_t
scale
;
...
...
source/client/src/clientImpl.c
浏览文件 @
200a6695
...
...
@@ -1762,6 +1762,10 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32
char
*
p
=
(
char
*
)
pResultInfo
->
pData
;
// version:
int32_t
blockVersion
=
*
(
int32_t
*
)
p
;
p
+=
sizeof
(
int32_t
);
int32_t
dataLen
=
*
(
int32_t
*
)
p
;
p
+=
sizeof
(
int32_t
);
...
...
@@ -1782,7 +1786,7 @@ int32_t setResultDataPtr(SReqResultInfo* pResultInfo, TAOS_FIELD* pFields, int32
// check fields
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
int16_t
type
=
*
(
int16_t
*
)
p
;
p
+=
sizeof
(
int
16
_t
);
p
+=
sizeof
(
int
8
_t
);
int32_t
bytes
=
*
(
int32_t
*
)
p
;
p
+=
sizeof
(
int32_t
);
...
...
source/common/src/tdatablock.c
浏览文件 @
200a6695
...
...
@@ -676,9 +676,9 @@ size_t blockDataGetRowSize(SSDataBlock* pBlock) {
* @return
*/
size_t
blockDataGetSerialMetaSize
(
uint32_t
numOfCols
)
{
// |
total length | total rows | total columns | has column
seg| block group id | column schema | each column length |
return
sizeof
(
int32_t
)
+
sizeof
(
int32_t
)
+
sizeof
(
int32_t
)
+
sizeof
(
int32_t
)
+
sizeof
(
uint64_t
)
+
numOfCols
*
(
sizeof
(
int
16
_t
)
+
sizeof
(
int32_t
))
+
numOfCols
*
sizeof
(
int32_t
);
// |
version | total length | total rows | total columns | flag
seg| block group id | column schema | each column length |
return
sizeof
(
int32_t
)
+
sizeof
(
int32_t
)
+
sizeof
(
int32_t
)
+
sizeof
(
int32_t
)
+
sizeof
(
int32_t
)
+
sizeof
(
uint64_t
)
+
numOfCols
*
(
sizeof
(
int
8
_t
)
+
sizeof
(
int32_t
))
+
numOfCols
*
sizeof
(
int32_t
);
}
double
blockDataGetSerialRowSize
(
const
SSDataBlock
*
pBlock
)
{
...
...
@@ -1582,7 +1582,7 @@ int32_t tEncodeDataBlock(void** buf, const SSDataBlock* pBlock) {
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
SColumnInfoData
*
pColData
=
(
SColumnInfoData
*
)
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
tlen
+=
taosEncodeFixedI16
(
buf
,
pColData
->
info
.
colId
);
tlen
+=
taosEncodeFixedI
16
(
buf
,
pColData
->
info
.
type
);
tlen
+=
taosEncodeFixedI
8
(
buf
,
pColData
->
info
.
type
);
tlen
+=
taosEncodeFixedI32
(
buf
,
pColData
->
info
.
bytes
);
tlen
+=
taosEncodeFixedBool
(
buf
,
pColData
->
hasNull
);
...
...
@@ -1614,7 +1614,7 @@ void* tDecodeDataBlock(const void* buf, SSDataBlock* pBlock) {
for
(
int32_t
i
=
0
;
i
<
sz
;
i
++
)
{
SColumnInfoData
data
=
{
0
};
buf
=
taosDecodeFixedI16
(
buf
,
&
data
.
info
.
colId
);
buf
=
taosDecodeFixedI
16
(
buf
,
&
data
.
info
.
type
);
buf
=
taosDecodeFixedI
8
(
buf
,
&
data
.
info
.
type
);
buf
=
taosDecodeFixedI32
(
buf
,
&
data
.
info
.
bytes
);
buf
=
taosDecodeFixedBool
(
buf
,
&
data
.
hasNull
);
...
...
@@ -2074,6 +2074,10 @@ char* buildCtbNameByGroupId(const char* stbName, uint64_t groupId) {
void
blockEncode
(
const
SSDataBlock
*
pBlock
,
char
*
data
,
int32_t
*
dataLen
,
int32_t
numOfCols
,
int8_t
needCompress
)
{
// todo extract method
int32_t
*
version
=
(
int32_t
*
)
data
;
*
version
=
1
;
data
+=
sizeof
(
int32_t
);
int32_t
*
actualLen
=
(
int32_t
*
)
data
;
data
+=
sizeof
(
int32_t
);
...
...
@@ -2085,8 +2089,11 @@ void blockEncode(const SSDataBlock* pBlock, char* data, int32_t* dataLen, int32_
*
cols
=
numOfCols
;
data
+=
sizeof
(
int32_t
);
int32_t
*
hasColumnSegment
=
(
int32_t
*
)
data
;
*
hasColumnSegment
=
1
;
// flag segment.
// the inital bit is for column info
int32_t
*
flagSegment
=
(
int32_t
*
)
data
;
*
flagSegment
=
(
1
<<
31
);
data
+=
sizeof
(
int32_t
);
uint64_t
*
groupId
=
(
uint64_t
*
)
data
;
...
...
@@ -2095,8 +2102,8 @@ void blockEncode(const SSDataBlock* pBlock, char* data, int32_t* dataLen, int32_
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
*
((
int
16
_t
*
)
data
)
=
pColInfoData
->
info
.
type
;
data
+=
sizeof
(
int
16
_t
);
*
((
int
8
_t
*
)
data
)
=
pColInfoData
->
info
.
type
;
data
+=
sizeof
(
int
8
_t
);
*
((
int32_t
*
)
data
)
=
pColInfoData
->
info
.
bytes
;
data
+=
sizeof
(
int32_t
);
...
...
@@ -2145,6 +2152,10 @@ void blockEncode(const SSDataBlock* pBlock, char* data, int32_t* dataLen, int32_
const
char
*
blockDecode
(
SSDataBlock
*
pBlock
,
const
char
*
pData
)
{
const
char
*
pStart
=
pData
;
int32_t
version
=
*
(
int32_t
*
)
pStart
;
pStart
+=
sizeof
(
int32_t
);
ASSERT
(
version
==
1
);
// total length sizeof(int32_t)
int32_t
dataLen
=
*
(
int32_t
*
)
pStart
;
pStart
+=
sizeof
(
int32_t
);
...
...
@@ -2158,7 +2169,8 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) {
pStart
+=
sizeof
(
int32_t
);
// has column info segment
int32_t
hasColumnInfo
=
*
(
int32_t
*
)
pStart
;
int32_t
flagSeg
=
*
(
int32_t
*
)
pStart
;
int32_t
hasColumnInfo
=
(
flagSeg
>>
31
);
pStart
+=
sizeof
(
int32_t
);
// group id sizeof(uint64_t)
...
...
@@ -2173,7 +2185,7 @@ const char* blockDecode(SSDataBlock* pBlock, const char* pData) {
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
pColInfoData
->
info
.
type
=
*
(
int16_t
*
)
pStart
;
pStart
+=
sizeof
(
int
16
_t
);
pStart
+=
sizeof
(
int
8
_t
);
pColInfoData
->
info
.
bytes
=
*
(
int32_t
*
)
pStart
;
pStart
+=
sizeof
(
int32_t
);
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
200a6695
...
...
@@ -4071,7 +4071,11 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
}
else
{
ASSERT
(
0
);
}
if
(
pOperator
!=
NULL
)
{
pOperator
->
resultDataBlockId
=
pPhyNode
->
pOutputDataBlockDesc
->
dataBlockId
;
}
return
pOperator
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录