Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
64d60e82
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1183
Star
22014
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
64d60e82
编写于
5月 25, 2022
作者:
L
Liu Jicong
提交者:
GitHub
5月 25, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #12981 from taosdata/feature/stream
fix(stream): handle null data
上级
f080f4aa
86c9446a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
14 addition
and
8 deletion
+14
-8
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+11
-7
source/libs/stream/src/tstream.c
source/libs/stream/src/tstream.c
+3
-1
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
64d60e82
...
@@ -350,7 +350,7 @@ int32_t blockDataUpdateTsWindow(SSDataBlock* pDataBlock, int32_t tsColumnIndex)
...
@@ -350,7 +350,7 @@ int32_t blockDataUpdateTsWindow(SSDataBlock* pDataBlock, int32_t tsColumnIndex)
return
-
1
;
return
-
1
;
}
}
int32_t
index
=
(
tsColumnIndex
==
-
1
)
?
0
:
tsColumnIndex
;
int32_t
index
=
(
tsColumnIndex
==
-
1
)
?
0
:
tsColumnIndex
;
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
index
);
SColumnInfoData
*
pColInfoData
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
index
);
if
(
pColInfoData
->
info
.
type
!=
TSDB_DATA_TYPE_TIMESTAMP
)
{
if
(
pColInfoData
->
info
.
type
!=
TSDB_DATA_TYPE_TIMESTAMP
)
{
return
0
;
return
0
;
...
@@ -599,8 +599,8 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
...
@@ -599,8 +599,8 @@ int32_t blockDataFromBuf(SSDataBlock* pBlock, const char* buf) {
}
}
int32_t
blockDataFromBuf1
(
SSDataBlock
*
pBlock
,
const
char
*
buf
,
size_t
capacity
)
{
int32_t
blockDataFromBuf1
(
SSDataBlock
*
pBlock
,
const
char
*
buf
,
size_t
capacity
)
{
pBlock
->
info
.
rows
=
*
(
int32_t
*
)
buf
;
pBlock
->
info
.
rows
=
*
(
int32_t
*
)
buf
;
pBlock
->
info
.
groupId
=
*
(
uint64_t
*
)
(
buf
+
sizeof
(
int32_t
));
pBlock
->
info
.
groupId
=
*
(
uint64_t
*
)(
buf
+
sizeof
(
int32_t
));
int32_t
numOfCols
=
pBlock
->
info
.
numOfCols
;
int32_t
numOfCols
=
pBlock
->
info
.
numOfCols
;
const
char
*
pStart
=
buf
+
sizeof
(
uint32_t
)
+
sizeof
(
uint64_t
);
const
char
*
pStart
=
buf
+
sizeof
(
uint32_t
)
+
sizeof
(
uint64_t
);
...
@@ -669,7 +669,7 @@ size_t blockDataGetSerialMetaSize(const SSDataBlock* pBlock) {
...
@@ -669,7 +669,7 @@ size_t blockDataGetSerialMetaSize(const SSDataBlock* pBlock) {
return
sizeof
(
int32_t
)
+
sizeof
(
uint64_t
)
+
pBlock
->
info
.
numOfCols
*
sizeof
(
int32_t
);
return
sizeof
(
int32_t
)
+
sizeof
(
uint64_t
)
+
pBlock
->
info
.
numOfCols
*
sizeof
(
int32_t
);
}
}
double
blockDataGetSerialRowSize
(
const
SSDataBlock
*
pBlock
)
{
double
blockDataGetSerialRowSize
(
const
SSDataBlock
*
pBlock
)
{
ASSERT
(
pBlock
!=
NULL
);
ASSERT
(
pBlock
!=
NULL
);
double
rowSize
=
0
;
double
rowSize
=
0
;
...
@@ -1232,7 +1232,7 @@ size_t blockDataGetCapacityInRow(const SSDataBlock* pBlock, size_t pageSize) {
...
@@ -1232,7 +1232,7 @@ size_t blockDataGetCapacityInRow(const SSDataBlock* pBlock, size_t pageSize) {
// the true value must be less than the value of nRows
// the true value must be less than the value of nRows
int32_t
additional
=
0
;
int32_t
additional
=
0
;
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
numOfCols
;
++
i
)
{
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
numOfCols
;
++
i
)
{
SColumnInfoData
*
pCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
SColumnInfoData
*
pCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
i
);
if
(
IS_VAR_DATA_TYPE
(
pCol
->
info
.
type
))
{
if
(
IS_VAR_DATA_TYPE
(
pCol
->
info
.
type
))
{
additional
+=
nRows
*
sizeof
(
int32_t
);
additional
+=
nRows
*
sizeof
(
int32_t
);
...
@@ -1728,8 +1728,12 @@ SSubmitReq* tdBlockToSubmit(const SArray* pBlocks, const STSchema* pTSchema, boo
...
@@ -1728,8 +1728,12 @@ SSubmitReq* tdBlockToSubmit(const SArray* pBlocks, const STSchema* pTSchema, boo
for
(
int32_t
k
=
0
;
k
<
pTSchema
->
numOfCols
;
k
++
)
{
for
(
int32_t
k
=
0
;
k
<
pTSchema
->
numOfCols
;
k
++
)
{
const
STColumn
*
pColumn
=
&
pTSchema
->
columns
[
k
];
const
STColumn
*
pColumn
=
&
pTSchema
->
columns
[
k
];
SColumnInfoData
*
pColData
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
k
);
SColumnInfoData
*
pColData
=
taosArrayGet
(
pDataBlock
->
pDataBlock
,
k
);
void
*
data
=
colDataGetData
(
pColData
,
j
);
if
(
colDataIsNull_s
(
pColData
,
j
))
{
tdAppendColValToRow
(
&
rb
,
pColumn
->
colId
,
pColumn
->
type
,
TD_VTYPE_NORM
,
data
,
true
,
pColumn
->
offset
,
k
);
tdAppendColValToRow
(
&
rb
,
pColumn
->
colId
,
pColumn
->
type
,
TD_VTYPE_NONE
,
NULL
,
false
,
pColumn
->
offset
,
k
);
}
else
{
void
*
data
=
colDataGetData
(
pColData
,
j
);
tdAppendColValToRow
(
&
rb
,
pColumn
->
colId
,
pColumn
->
type
,
TD_VTYPE_NORM
,
data
,
true
,
pColumn
->
offset
,
k
);
}
}
}
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
int32_t
rowLen
=
TD_ROW_LEN
(
rowData
);
rowData
=
POINTER_SHIFT
(
rowData
,
rowLen
);
rowData
=
POINTER_SHIFT
(
rowData
,
rowLen
);
...
...
source/libs/stream/src/tstream.c
浏览文件 @
64d60e82
...
@@ -158,7 +158,9 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, void* data, SArray* pRes)
...
@@ -158,7 +158,9 @@ static int32_t streamTaskExecImpl(SStreamTask* pTask, void* data, SArray* pRes)
ASSERT
(
false
);
ASSERT
(
false
);
}
}
if
(
output
==
NULL
)
break
;
if
(
output
==
NULL
)
break
;
taosArrayPush
(
pRes
,
output
);
// TODO: do we need free memory?
SSDataBlock
*
outputCopy
=
createOneDataBlock
(
output
,
true
);
taosArrayPush
(
pRes
,
outputCopy
);
}
}
// destroy
// destroy
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录