Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
73aa96e1
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看板
未验证
提交
73aa96e1
编写于
8月 06, 2022
作者:
L
liuyao
提交者:
GitHub
8月 06, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #15792 from taosdata/feature/TD-18180
fix(stream):set num of stream session child
上级
bd1b7823
214d3609
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
17 addition
and
35 deletion
+17
-35
include/common/tcommon.h
include/common/tcommon.h
+1
-0
include/common/tmsg.h
include/common/tmsg.h
+1
-0
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+1
-2
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+1
-0
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+1
-1
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+10
-32
source/libs/stream/src/streamData.c
source/libs/stream/src/streamData.c
+1
-0
source/libs/stream/src/streamDispatch.c
source/libs/stream/src/streamDispatch.c
+1
-0
未找到文件。
include/common/tcommon.h
浏览文件 @
73aa96e1
...
...
@@ -107,6 +107,7 @@ typedef struct SDataBlockInfo {
int32_t
childId
;
// used for stream, do not serialize
EStreamType
type
;
// used for stream, do not serialize
STimeWindow
calWin
;
// used for stream, do not serialize
TSKEY
watermark
;
// used for stream
}
SDataBlockInfo
;
typedef
struct
SSDataBlock
{
...
...
include/common/tmsg.h
浏览文件 @
73aa96e1
...
...
@@ -1369,6 +1369,7 @@ typedef struct {
int64_t
skey
;
int64_t
ekey
;
int64_t
version
;
// for stream
TSKEY
watermark
;
// for stream
char
data
[];
}
SRetrieveTableRsp
;
...
...
source/common/src/tdatablock.c
浏览文件 @
73aa96e1
...
...
@@ -1272,8 +1272,7 @@ int32_t assignOneDataBlock(SSDataBlock* dst, const SSDataBlock* src) {
colDataAssign
(
pDst
,
pSrc
,
src
->
info
.
rows
,
&
src
->
info
);
}
dst
->
info
.
rows
=
src
->
info
.
rows
;
dst
->
info
.
capacity
=
src
->
info
.
rows
;
dst
->
info
=
src
->
info
;
return
0
;
}
...
...
source/libs/executor/src/executil.c
浏览文件 @
73aa96e1
...
...
@@ -191,6 +191,7 @@ SSDataBlock* createResDataBlock(SDataBlockDescNode* pNode) {
pBlock
->
info
.
blockId
=
pNode
->
dataBlockId
;
pBlock
->
info
.
type
=
STREAM_INVALID
;
pBlock
->
info
.
calWin
=
(
STimeWindow
){.
skey
=
INT64_MIN
,
.
ekey
=
INT64_MAX
};
pBlock
->
info
.
watermark
=
INT64_MIN
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SSlotDescNode
*
pDescNode
=
(
SSlotDescNode
*
)
nodesListGetNode
(
pNode
->
pSlots
,
i
);
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
73aa96e1
...
...
@@ -4180,7 +4180,7 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
int32_t
children
=
0
;
pOptr
=
createStreamFinalSessionAggOperatorInfo
(
ops
[
0
],
pPhyNode
,
pTaskInfo
,
children
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_SESSION
==
type
)
{
int32_t
children
=
1
;
int32_t
children
=
pHandle
->
numOfVgroups
;
pOptr
=
createStreamFinalSessionAggOperatorInfo
(
ops
[
0
],
pPhyNode
,
pTaskInfo
,
children
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_PARTITION
==
type
)
{
pOptr
=
createPartitionOperatorInfo
(
ops
[
0
],
(
SPartitionPhysiNode
*
)
pPhyNode
,
pTaskInfo
);
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
73aa96e1
...
...
@@ -1752,30 +1752,11 @@ void increaseTs(SqlFunctionCtx* pCtx) {
}
}
SSDataBlock
*
createDeleteBlock
()
{
SSDataBlock
*
pBlock
=
taosMemoryCalloc
(
1
,
sizeof
(
SSDataBlock
));
pBlock
->
info
.
hasVarCol
=
false
;
pBlock
->
info
.
groupId
=
0
;
pBlock
->
info
.
rows
=
0
;
pBlock
->
info
.
type
=
STREAM_DELETE_RESULT
;
pBlock
->
info
.
rowSize
=
sizeof
(
TSKEY
)
+
sizeof
(
uint64_t
);
pBlock
->
pDataBlock
=
taosArrayInit
(
2
,
sizeof
(
SColumnInfoData
));
SColumnInfoData
infoData
=
{
0
};
infoData
.
info
.
type
=
TSDB_DATA_TYPE_TIMESTAMP
;
infoData
.
info
.
bytes
=
sizeof
(
TSKEY
);
// window start ts
taosArrayPush
(
pBlock
->
pDataBlock
,
&
infoData
);
infoData
.
info
.
type
=
TSDB_DATA_TYPE_UBIGINT
;
infoData
.
info
.
bytes
=
sizeof
(
uint64_t
);
taosArrayPush
(
pBlock
->
pDataBlock
,
&
infoData
);
return
pBlock
;
}
void
initIntervalDownStream
(
SOperatorInfo
*
downstream
,
uint8_t
type
,
SAggSupporter
*
pSup
)
{
ASSERT
(
downstream
->
operatorType
==
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
);
if
(
downstream
->
operatorType
!=
QUERY_NODE_PHYSICAL_PLAN_STREAM_SCAN
)
{
// Todo(liuyao) support partition by column
return
;
}
SStreamScanInfo
*
pScanInfo
=
downstream
->
info
;
pScanInfo
->
sessionSup
.
parentType
=
type
;
pScanInfo
->
sessionSup
.
pIntervalAggSup
=
pSup
;
...
...
@@ -2872,13 +2853,6 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
// process the rest of the data
return
pInfo
->
pUpdateRes
;
}
// doBuildPullDataBlock(pInfo->pPullWins, &pInfo->pullIndex, pInfo->pPullDataRes);
// if (pInfo->pPullDataRes->info.rows != 0) {
// // process the rest of the data
// ASSERT(IS_FINAL_OP(pInfo));
// printDataBlock(pInfo->pPullDataRes, IS_FINAL_OP(pInfo) ? "interval final" : "interval semi");
// return pInfo->pPullDataRes;
// }
doBuildDeleteResult
(
pInfo
->
pDelWins
,
&
pInfo
->
delIndex
,
pInfo
->
pDelRes
);
if
(
pInfo
->
pDelRes
->
info
.
rows
!=
0
)
{
// process the rest of the data
...
...
@@ -2898,6 +2872,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
}
printDataBlock
(
pBlock
,
IS_FINAL_OP
(
pInfo
)
?
"interval final recv"
:
"interval semi recv"
);
maxTs
=
TMAX
(
maxTs
,
pBlock
->
info
.
window
.
ekey
);
maxTs
=
TMAX
(
maxTs
,
pBlock
->
info
.
watermark
);
if
(
pBlock
->
info
.
type
==
STREAM_NORMAL
||
pBlock
->
info
.
type
==
STREAM_PULL_DATA
||
pBlock
->
info
.
type
==
STREAM_INVALID
)
{
...
...
@@ -2986,6 +2961,8 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
closeIntervalWindow
(
pInfo
->
aggSup
.
pResultRowHashTable
,
&
pInfo
->
twAggSup
,
&
pInfo
->
interval
,
pInfo
->
pPullDataMap
,
pUpdated
,
pInfo
->
pRecycledPages
,
pInfo
->
aggSup
.
pResultBuf
);
closeChildIntervalWindow
(
pInfo
->
pChildren
,
pInfo
->
twAggSup
.
maxTs
);
}
else
{
pInfo
->
binfo
.
pRes
->
info
.
watermark
=
pInfo
->
twAggSup
.
maxTs
;
}
finalizeUpdatedResult
(
pOperator
->
exprSupp
.
numOfExprs
,
pInfo
->
aggSup
.
pResultBuf
,
pUpdated
,
pSup
->
rowEntryInfoOffset
);
...
...
@@ -3020,7 +2997,6 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
printDataBlock
(
pInfo
->
pDelRes
,
IS_FINAL_OP
(
pInfo
)
?
"interval final"
:
"interval semi"
);
return
pInfo
->
pDelRes
;
}
// ASSERT(false);
return
NULL
;
}
...
...
@@ -3032,6 +3008,7 @@ SSDataBlock* createSpecialDataBlock(EStreamType type) {
pBlock
->
info
.
type
=
type
;
pBlock
->
info
.
rowSize
=
sizeof
(
TSKEY
)
+
sizeof
(
TSKEY
)
+
sizeof
(
uint64_t
)
+
sizeof
(
uint64_t
)
+
sizeof
(
TSKEY
)
+
sizeof
(
TSKEY
);
pBlock
->
info
.
watermark
=
INT64_MIN
;
pBlock
->
pDataBlock
=
taosArrayInit
(
6
,
sizeof
(
SColumnInfoData
));
SColumnInfoData
infoData
=
{
0
};
...
...
@@ -3221,7 +3198,6 @@ void destroyStreamSessionAggOperatorInfo(void* param, int32_t numOfOutput) {
SStreamSessionAggOperatorInfo
*
pChInfo
=
pChild
->
info
;
destroyStreamSessionAggOperatorInfo
(
pChInfo
,
numOfOutput
);
taosMemoryFreeClear
(
pChild
);
taosMemoryFreeClear
(
pChInfo
);
}
}
colDataDestroy
(
&
pInfo
->
twAggSup
.
timeWindowData
);
...
...
@@ -3986,6 +3962,7 @@ static SSDataBlock* doStreamSessionAgg(SOperatorInfo* pOperator) {
doStreamSessionAggImpl
(
pChildOp
,
pBlock
,
NULL
,
NULL
,
true
);
}
maxTs
=
TMAX
(
maxTs
,
pBlock
->
info
.
window
.
ekey
);
maxTs
=
TMAX
(
maxTs
,
pBlock
->
info
.
watermark
);
}
pInfo
->
twAggSup
.
maxTs
=
TMAX
(
pInfo
->
twAggSup
.
maxTs
,
maxTs
);
...
...
@@ -4109,6 +4086,7 @@ static SSDataBlock* doStreamSessionSemiAgg(SOperatorInfo* pOperator) {
}
pInfo
->
twAggSup
.
maxTs
=
TMAX
(
pInfo
->
twAggSup
.
maxTs
,
maxTs
);
pBInfo
->
pRes
->
info
.
watermark
=
pInfo
->
twAggSup
.
maxTs
;
// restore the value
pOperator
->
status
=
OP_RES_TO_RETURN
;
// semi operator
...
...
source/libs/stream/src/streamData.c
浏览文件 @
73aa96e1
...
...
@@ -35,6 +35,7 @@ int32_t streamDispatchReqToData(const SStreamDispatchReq* pReq, SStreamDataBlock
pDataBlock
->
info
.
window
.
skey
=
be64toh
(
pRetrieve
->
skey
);
pDataBlock
->
info
.
window
.
ekey
=
be64toh
(
pRetrieve
->
ekey
);
pDataBlock
->
info
.
version
=
be64toh
(
pRetrieve
->
version
);
pDataBlock
->
info
.
watermark
=
be64toh
(
pRetrieve
->
watermark
);
pDataBlock
->
info
.
type
=
pRetrieve
->
streamBlockType
;
pDataBlock
->
info
.
childId
=
pReq
->
upstreamChildId
;
...
...
source/libs/stream/src/streamDispatch.c
浏览文件 @
73aa96e1
...
...
@@ -184,6 +184,7 @@ static int32_t streamAddBlockToDispatchMsg(const SSDataBlock* pBlock, SStreamDis
pRetrieve
->
skey
=
htobe64
(
pBlock
->
info
.
window
.
skey
);
pRetrieve
->
ekey
=
htobe64
(
pBlock
->
info
.
window
.
ekey
);
pRetrieve
->
version
=
htobe64
(
pBlock
->
info
.
version
);
pRetrieve
->
watermark
=
htobe64
(
pBlock
->
info
.
watermark
);
int32_t
numOfCols
=
(
int32_t
)
taosArrayGetSize
(
pBlock
->
pDataBlock
);
pRetrieve
->
numOfCols
=
htonl
(
numOfCols
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录