Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
b5f6272b
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
b5f6272b
编写于
6月 10, 2022
作者:
L
liuyao
提交者:
GitHub
6月 10, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #13682 from taosdata/feature/TD-16285
feat(stream): distribute stream interval
上级
dba09f9c
c790ac64
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
21 addition
and
9 deletion
+21
-9
source/common/src/tdatablock.c
source/common/src/tdatablock.c
+3
-0
source/libs/executor/src/executorimpl.c
source/libs/executor/src/executorimpl.c
+4
-2
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+12
-3
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+2
-4
未找到文件。
source/common/src/tdatablock.c
浏览文件 @
b5f6272b
...
...
@@ -1219,6 +1219,8 @@ SSDataBlock* createOneDataBlock(const SSDataBlock* pDataBlock, bool copyData) {
pBlock
->
info
.
hasVarCol
=
pDataBlock
->
info
.
hasVarCol
;
pBlock
->
info
.
rowSize
=
pDataBlock
->
info
.
rowSize
;
pBlock
->
info
.
groupId
=
pDataBlock
->
info
.
groupId
;
pBlock
->
info
.
childId
=
pDataBlock
->
info
.
childId
;
pBlock
->
info
.
type
=
pDataBlock
->
info
.
type
;
for
(
int32_t
i
=
0
;
i
<
numOfCols
;
++
i
)
{
SColumnInfoData
colInfo
=
{
0
};
...
...
@@ -1499,6 +1501,7 @@ void blockDebugShowData(const SArray* dataBlocks, const char* flag) {
SSDataBlock
*
pDataBlock
=
taosArrayGet
(
dataBlocks
,
i
);
int32_t
colNum
=
pDataBlock
->
info
.
numOfCols
;
int32_t
rows
=
pDataBlock
->
info
.
rows
;
printf
(
"%s |block type %d |child id %d|
\n
"
,
flag
,
(
int32_t
)
pDataBlock
->
info
.
type
,
pDataBlock
->
info
.
childId
);
for
(
int32_t
j
=
0
;
j
<
rows
;
j
++
)
{
printf
(
"%s |"
,
flag
);
for
(
int32_t
k
=
0
;
k
<
colNum
;
k
++
)
{
...
...
source/libs/executor/src/executorimpl.c
浏览文件 @
b5f6272b
...
...
@@ -4690,10 +4690,12 @@ SOperatorInfo* createOperatorTree(SPhysiNode* pPhyNode, SExecTaskInfo* pTaskInfo
createIntervalOperatorInfo
(
ops
[
0
],
pExprInfo
,
num
,
pResBlock
,
&
interval
,
tsSlotId
,
&
as
,
pTaskInfo
,
isStream
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_STREAM_SEMI_INTERVAL
==
type
)
{
int32_t
children
=
8
;
qDebug
(
"[******]create Semi"
);
int32_t
children
=
0
;
pOptr
=
createStreamFinalIntervalOperatorInfo
(
ops
[
0
],
pPhyNode
,
pTaskInfo
,
children
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_STREAM_FINAL_INTERVAL
==
type
)
{
int32_t
children
=
0
;
qDebug
(
"[******]create Final"
);
int32_t
children
=
1
;
pOptr
=
createStreamFinalIntervalOperatorInfo
(
ops
[
0
],
pPhyNode
,
pTaskInfo
,
children
);
}
else
if
(
QUERY_NODE_PHYSICAL_PLAN_SORT
==
type
)
{
SSortPhysiNode
*
pSortPhyNode
=
(
SSortPhysiNode
*
)
pPhyNode
;
...
...
source/libs/executor/src/scanoperator.c
浏览文件 @
b5f6272b
...
...
@@ -809,11 +809,18 @@ static void getUpdateDataBlock(SStreamBlockScanInfo* pInfo, bool invertible, SSD
// return p;
SColumnInfoData
*
pCol
=
(
SColumnInfoData
*
)
taosArrayGet
(
pUpdateBlock
->
pDataBlock
,
pInfo
->
primaryTsIndex
);
ASSERT
(
pCol
->
info
.
type
==
TSDB_DATA_TYPE_TIMESTAMP
);
colInfoDataEnsureCapacity
(
pCol
,
0
,
size
);
blockDataEnsureCapacity
(
pUpdateBlock
,
size
);
for
(
int32_t
i
=
0
;
i
<
size
;
i
++
)
{
TSKEY
*
pTs
=
(
TSKEY
*
)
taosArrayGet
(
pInfo
->
tsArray
,
i
);
colDataAppend
(
pCol
,
i
,
(
char
*
)
pTs
,
false
);
}
for
(
int32_t
i
=
0
;
i
<
pUpdateBlock
->
info
.
numOfCols
;
i
++
)
{
if
(
i
==
pInfo
->
primaryTsIndex
)
{
continue
;
}
SColumnInfoData
*
pCol
=
(
SColumnInfoData
*
)
taosArrayGet
(
pUpdateBlock
->
pDataBlock
,
i
);
colDataAppendNNULL
(
pCol
,
0
,
size
);
}
pUpdateBlock
->
info
.
rows
=
size
;
pUpdateBlock
->
info
.
type
=
STREAM_REPROCESS
;
blockDataUpdateTsWindow
(
pUpdateBlock
,
0
);
...
...
@@ -841,7 +848,9 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
}
int32_t
current
=
pInfo
->
validBlockIndex
++
;
return
taosArrayGetP
(
pInfo
->
pBlockLists
,
current
);
SSDataBlock
*
pBlock
=
taosArrayGetP
(
pInfo
->
pBlockLists
,
current
);
blockDataUpdateTsWindow
(
pBlock
,
0
);
return
pBlock
;
}
else
{
if
(
pInfo
->
scanMode
==
STREAM_SCAN_FROM_RES
)
{
blockDataDestroy
(
pInfo
->
pUpdateRes
);
...
...
@@ -940,7 +949,7 @@ static SSDataBlock* doStreamBlockScan(SOperatorInfo* pOperator) {
}
doFilter
(
pInfo
->
pCondition
,
pInfo
->
pRes
,
false
);
blockDataUpdateTsWindow
(
pInfo
->
pRes
,
0
);
blockDataUpdateTsWindow
(
pInfo
->
pRes
,
pInfo
->
primaryTsIndex
);
break
;
}
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
b5f6272b
...
...
@@ -1925,6 +1925,7 @@ static void doHashInterval(SOperatorInfo* pOperatorInfo, SSDataBlock* pSDataBloc
doApplyFunctions
(
pTaskInfo
,
pInfo
->
binfo
.
pCtx
,
&
nextWin
,
&
pInfo
->
twAggSup
.
timeWindowData
,
startPos
,
forwardRows
,
tsCols
,
pSDataBlock
->
info
.
rows
,
numOfOutput
,
TSDB_ORDER_ASC
);
int32_t
prevEndPos
=
(
forwardRows
-
1
)
*
step
+
startPos
;
ASSERT
(
pSDataBlock
->
info
.
window
.
skey
>
0
&&
pSDataBlock
->
info
.
window
.
ekey
>
0
);
startPos
=
getNextQualifiedWindow
(
&
pInfo
->
interval
,
&
nextWin
,
&
pSDataBlock
->
info
,
tsCols
,
prevEndPos
,
pInfo
->
order
);
if
(
startPos
<
0
)
{
break
;
...
...
@@ -2003,10 +2004,7 @@ static void copyUpdateDataBlock(SSDataBlock* pDest, SSDataBlock* pSource, int32_
}
static
int32_t
getChildIndex
(
SSDataBlock
*
pBlock
)
{
// if (pBlock->info.type != STREAM_INVALID && pBlock->info.rows < 4) { // for test
// return pBlock->info.rows - 1;
// }
return
0
;
return
pBlock
->
info
.
childId
;
}
static
SSDataBlock
*
doStreamFinalIntervalAgg
(
SOperatorInfo
*
pOperator
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录