Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
9b29fa0c
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看板
未验证
提交
9b29fa0c
编写于
11月 17, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
11月 17, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18223 from taosdata/feature/stream
fix(stream): stop scan when no output
上级
40900b7e
5161eca7
变更
4
显示空白变更内容
内联
并排
Showing
4 changed file
with
14 addition
and
6 deletion
+14
-6
include/libs/stream/tstreamUpdate.h
include/libs/stream/tstreamUpdate.h
+1
-1
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+3
-1
source/libs/stream/src/streamExec.c
source/libs/stream/src/streamExec.c
+6
-1
source/libs/stream/src/streamUpdate.c
source/libs/stream/src/streamUpdate.c
+4
-3
未找到文件。
include/libs/stream/tstreamUpdate.h
浏览文件 @
9b29fa0c
...
@@ -47,7 +47,7 @@ typedef struct SUpdateInfo {
...
@@ -47,7 +47,7 @@ typedef struct SUpdateInfo {
SUpdateInfo
*
updateInfoInitP
(
SInterval
*
pInterval
,
int64_t
watermark
);
SUpdateInfo
*
updateInfoInitP
(
SInterval
*
pInterval
,
int64_t
watermark
);
SUpdateInfo
*
updateInfoInit
(
int64_t
interval
,
int32_t
precision
,
int64_t
watermark
);
SUpdateInfo
*
updateInfoInit
(
int64_t
interval
,
int32_t
precision
,
int64_t
watermark
);
void
updateInfoFillBlockData
(
SUpdateInfo
*
pInfo
,
SSDataBlock
*
pBlock
,
int32_t
primaryTsCol
);
TSKEY
updateInfoFillBlockData
(
SUpdateInfo
*
pInfo
,
SSDataBlock
*
pBlock
,
int32_t
primaryTsCol
);
bool
updateInfoIsUpdated
(
SUpdateInfo
*
pInfo
,
uint64_t
tableId
,
TSKEY
ts
);
bool
updateInfoIsUpdated
(
SUpdateInfo
*
pInfo
,
uint64_t
tableId
,
TSKEY
ts
);
bool
updateInfoIsTableInserted
(
SUpdateInfo
*
pInfo
,
int64_t
tbUid
);
bool
updateInfoIsTableInserted
(
SUpdateInfo
*
pInfo
,
int64_t
tbUid
);
void
updateInfoSetScanRange
(
SUpdateInfo
*
pInfo
,
STimeWindow
*
pWin
,
uint64_t
groupId
,
uint64_t
version
);
void
updateInfoSetScanRange
(
SUpdateInfo
*
pInfo
,
STimeWindow
*
pWin
,
uint64_t
groupId
,
uint64_t
version
);
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
9b29fa0c
...
@@ -1981,9 +1981,11 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
...
@@ -1981,9 +1981,11 @@ static SSDataBlock* doStreamScan(SOperatorInfo* pOperator) {
if
(
pBlock
!=
NULL
)
{
if
(
pBlock
!=
NULL
)
{
calBlockTbName
(
pInfo
,
pBlock
);
calBlockTbName
(
pInfo
,
pBlock
);
if
(
pInfo
->
pUpdateInfo
)
{
if
(
pInfo
->
pUpdateInfo
)
{
updateInfoFillBlockData
(
pInfo
->
pUpdateInfo
,
pBlock
,
pInfo
->
primaryTsIndex
);
TSKEY
maxTs
=
updateInfoFillBlockData
(
pInfo
->
pUpdateInfo
,
pBlock
,
pInfo
->
primaryTsIndex
);
pInfo
->
twAggSup
.
maxTs
=
TMAX
(
pInfo
->
twAggSup
.
maxTs
,
maxTs
);
}
}
qDebug
(
"stream recover scan get block, rows %d"
,
pBlock
->
info
.
rows
);
qDebug
(
"stream recover scan get block, rows %d"
,
pBlock
->
info
.
rows
);
printDataBlock
(
pBlock
,
"scan recover"
);
return
pBlock
;
return
pBlock
;
}
}
pTaskInfo
->
streamInfo
.
recoverStep
=
STREAM_RECOVER_STEP__NONE
;
pTaskInfo
->
streamInfo
.
recoverStep
=
STREAM_RECOVER_STEP__NONE
;
...
...
source/libs/stream/src/streamExec.c
浏览文件 @
9b29fa0c
...
@@ -91,6 +91,7 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) {
...
@@ -91,6 +91,7 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) {
void
*
exec
=
pTask
->
exec
.
executor
;
void
*
exec
=
pTask
->
exec
.
executor
;
qSetStreamOpOpen
(
exec
);
qSetStreamOpOpen
(
exec
);
bool
finished
=
false
;
while
(
1
)
{
while
(
1
)
{
SArray
*
pRes
=
taosArrayInit
(
0
,
sizeof
(
SSDataBlock
));
SArray
*
pRes
=
taosArrayInit
(
0
,
sizeof
(
SSDataBlock
));
...
@@ -106,7 +107,10 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) {
...
@@ -106,7 +107,10 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) {
if
(
qExecTask
(
exec
,
&
output
,
&
ts
)
<
0
)
{
if
(
qExecTask
(
exec
,
&
output
,
&
ts
)
<
0
)
{
ASSERT
(
0
);
ASSERT
(
0
);
}
}
if
(
output
==
NULL
)
break
;
if
(
output
==
NULL
)
{
finished
=
true
;
break
;
}
SSDataBlock
block
=
{
0
};
SSDataBlock
block
=
{
0
};
assignOneDataBlock
(
&
block
,
output
);
assignOneDataBlock
(
&
block
,
output
);
...
@@ -133,6 +137,7 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) {
...
@@ -133,6 +137,7 @@ int32_t streamScanExec(SStreamTask* pTask, int32_t batchSz) {
if
(
pTask
->
outputType
==
TASK_OUTPUT__FIXED_DISPATCH
||
pTask
->
outputType
==
TASK_OUTPUT__SHUFFLE_DISPATCH
)
{
if
(
pTask
->
outputType
==
TASK_OUTPUT__FIXED_DISPATCH
||
pTask
->
outputType
==
TASK_OUTPUT__SHUFFLE_DISPATCH
)
{
streamDispatch
(
pTask
);
streamDispatch
(
pTask
);
}
}
if
(
finished
)
break
;
}
}
return
0
;
return
0
;
}
}
...
...
source/libs/stream/src/streamUpdate.c
浏览文件 @
9b29fa0c
...
@@ -163,9 +163,9 @@ bool updateInfoIsTableInserted(SUpdateInfo *pInfo, int64_t tbUid) {
...
@@ -163,9 +163,9 @@ bool updateInfoIsTableInserted(SUpdateInfo *pInfo, int64_t tbUid) {
return
false
;
return
false
;
}
}
void
updateInfoFillBlockData
(
SUpdateInfo
*
pInfo
,
SSDataBlock
*
pBlock
,
int32_t
primaryTsCol
)
{
TSKEY
updateInfoFillBlockData
(
SUpdateInfo
*
pInfo
,
SSDataBlock
*
pBlock
,
int32_t
primaryTsCol
)
{
if
(
pBlock
==
NULL
||
pBlock
->
info
.
rows
==
0
)
return
;
if
(
pBlock
==
NULL
||
pBlock
->
info
.
rows
==
0
)
return
INT64_MIN
;
TSKEY
maxTs
=
-
1
;
TSKEY
maxTs
=
INT64_MIN
;
int64_t
tbUid
=
pBlock
->
info
.
uid
;
int64_t
tbUid
=
pBlock
->
info
.
uid
;
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
primaryTsCol
);
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pBlock
->
pDataBlock
,
primaryTsCol
);
...
@@ -186,6 +186,7 @@ void updateInfoFillBlockData(SUpdateInfo *pInfo, SSDataBlock *pBlock, int32_t pr
...
@@ -186,6 +186,7 @@ void updateInfoFillBlockData(SUpdateInfo *pInfo, SSDataBlock *pBlock, int32_t pr
if
(
pMaxTs
==
NULL
||
*
pMaxTs
>
maxTs
)
{
if
(
pMaxTs
==
NULL
||
*
pMaxTs
>
maxTs
)
{
taosHashPut
(
pInfo
->
pMap
,
&
tbUid
,
sizeof
(
int64_t
),
&
maxTs
,
sizeof
(
TSKEY
));
taosHashPut
(
pInfo
->
pMap
,
&
tbUid
,
sizeof
(
int64_t
),
&
maxTs
,
sizeof
(
TSKEY
));
}
}
return
maxTs
;
}
}
bool
updateInfoIsUpdated
(
SUpdateInfo
*
pInfo
,
uint64_t
tableId
,
TSKEY
ts
)
{
bool
updateInfoIsUpdated
(
SUpdateInfo
*
pInfo
,
uint64_t
tableId
,
TSKEY
ts
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录