Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
1f77b78d
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看板
未验证
提交
1f77b78d
编写于
11月 28, 2022
作者:
S
Shengliang Guan
提交者:
GitHub
11月 28, 2022
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #18515 from taosdata/feature/stream
fix(stream): fill combine with subtable
上级
5259aa13
95e4a481
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
29 addition
and
10 deletion
+29
-10
source/libs/executor/src/tfill.c
source/libs/executor/src/tfill.c
+29
-10
未找到文件。
source/libs/executor/src/tfill.c
浏览文件 @
1f77b78d
...
...
@@ -1282,7 +1282,9 @@ static void doStreamFillImpl(SOperatorInfo* pOperator) {
blockDataCleanup
(
pInfo
->
pSrcBlock
);
}
static
void
buildDeleteRange
(
TSKEY
start
,
TSKEY
end
,
uint64_t
groupId
,
SSDataBlock
*
delRes
)
{
static
void
buildDeleteRange
(
SOperatorInfo
*
pOp
,
TSKEY
start
,
TSKEY
end
,
uint64_t
groupId
,
SSDataBlock
*
delRes
)
{
SStreamState
*
pState
=
pOp
->
pTaskInfo
->
streamInfo
.
pState
;
SSDataBlock
*
pBlock
=
delRes
;
SColumnInfoData
*
pStartCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
START_TS_COLUMN_INDEX
);
SColumnInfoData
*
pEndCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
END_TS_COLUMN_INDEX
);
...
...
@@ -1290,25 +1292,42 @@ static void buildDeleteRange(TSKEY start, TSKEY end, uint64_t groupId, SSDataBlo
SColumnInfoData
*
pGroupCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
GROUPID_COLUMN_INDEX
);
SColumnInfoData
*
pCalStartCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
CALCULATE_START_TS_COLUMN_INDEX
);
SColumnInfoData
*
pCalEndCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
CALCULATE_END_TS_COLUMN_INDEX
);
SColumnInfoData
*
pTbNameCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
TABLE_NAME_COLUMN_INDEX
);
colDataAppend
(
pStartCol
,
pBlock
->
info
.
rows
,
(
const
char
*
)
&
start
,
false
);
colDataAppend
(
pEndCol
,
pBlock
->
info
.
rows
,
(
const
char
*
)
&
end
,
false
);
colDataAppendNULL
(
pUidCol
,
pBlock
->
info
.
rows
);
colDataAppend
(
pGroupCol
,
pBlock
->
info
.
rows
,
(
const
char
*
)
&
groupId
,
false
);
colDataAppendNULL
(
pCalStartCol
,
pBlock
->
info
.
rows
);
colDataAppendNULL
(
pCalEndCol
,
pBlock
->
info
.
rows
);
SColumnInfoData
*
pTableCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
TABLE_NAME_COLUMN_INDEX
);
void
*
tbname
=
NULL
;
streamStateGetParName
(
pOp
->
pTaskInfo
->
streamInfo
.
pState
,
groupId
,
&
tbname
);
if
(
tbname
==
NULL
)
{
colDataAppendNULL
(
pTableCol
,
pBlock
->
info
.
rows
);
}
else
{
char
parTbName
[
VARSTR_HEADER_SIZE
+
TSDB_TABLE_NAME_LEN
];
STR_WITH_MAXSIZE_TO_VARSTR
(
parTbName
,
tbname
,
sizeof
(
parTbName
));
colDataAppend
(
pTableCol
,
pBlock
->
info
.
rows
,
(
const
char
*
)
parTbName
,
false
);
}
tdbFree
(
tbname
);
pBlock
->
info
.
rows
++
;
}
static
void
buildDeleteResult
(
S
StreamFillSupporter
*
pFillSup
,
TSKEY
startTs
,
TSKEY
endTs
,
uint64_t
groupId
,
static
void
buildDeleteResult
(
S
OperatorInfo
*
pOperator
,
TSKEY
startTs
,
TSKEY
endTs
,
uint64_t
groupId
,
SSDataBlock
*
delRes
)
{
SStreamFillOperatorInfo
*
pInfo
=
pOperator
->
info
;
SStreamFillSupporter
*
pFillSup
=
pInfo
->
pFillSup
;
if
(
hasPrevWindow
(
pFillSup
))
{
TSKEY
start
=
getNextWindowTs
(
pFillSup
->
prev
.
key
,
&
pFillSup
->
interval
);
buildDeleteRange
(
start
,
endTs
,
groupId
,
delRes
);
buildDeleteRange
(
pOperator
,
start
,
endTs
,
groupId
,
delRes
);
}
else
if
(
hasNextWindow
(
pFillSup
))
{
TSKEY
end
=
getPrevWindowTs
(
pFillSup
->
next
.
key
,
&
pFillSup
->
interval
);
buildDeleteRange
(
startTs
,
end
,
groupId
,
delRes
);
buildDeleteRange
(
pOperator
,
startTs
,
end
,
groupId
,
delRes
);
}
else
{
buildDeleteRange
(
startTs
,
endTs
,
groupId
,
delRes
);
buildDeleteRange
(
pOperator
,
startTs
,
endTs
,
groupId
,
delRes
);
}
}
...
...
@@ -1319,7 +1338,7 @@ static void doDeleteFillResultImpl(SOperatorInfo* pOperator, TSKEY startTs, TSKE
SWinKey
key
=
{.
ts
=
startTs
,
.
groupId
=
groupId
};
if
(
!
pInfo
->
pFillInfo
->
needFill
)
{
streamStateFillDel
(
pOperator
->
pTaskInfo
->
streamInfo
.
pState
,
&
key
);
buildDeleteResult
(
p
Info
->
pFillSup
,
startTs
,
endTs
,
groupId
,
pInfo
->
pDelRes
);
buildDeleteResult
(
p
Operator
,
startTs
,
endTs
,
groupId
,
pInfo
->
pDelRes
);
}
else
{
STimeRange
tw
=
{
.
skey
=
startTs
,
...
...
@@ -1578,7 +1597,7 @@ static SStreamFillSupporter* initStreamFillSup(SStreamFillPhysiNode* pPhyFillNod
destroyStreamFillSupporter
(
pFillSup
);
return
NULL
;
}
SExprInfo
*
noFillExpr
=
createExprInfo
(
pPhyFillNode
->
pNotFillExprs
,
NULL
,
&
numOfNotFillCols
);
code
=
initExprSupp
(
&
pFillSup
->
notFillExprSup
,
noFillExpr
,
numOfNotFillCols
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
@@ -1715,9 +1734,9 @@ SOperatorInfo* createStreamFillOperatorInfo(SOperatorInfo* downstream, SStreamFi
}
pInfo
->
srcRowIndex
=
0
;
setOperatorInfo
(
pOperator
,
"StreamFillOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL
,
false
,
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
pOperator
->
fpSet
=
createOperatorFpSet
(
operatorDummyOpenFn
,
doStreamFill
,
NULL
,
destroyStreamFillOperatorInfo
,
NULL
);
setOperatorInfo
(
pOperator
,
"StreamFillOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_FILL
,
false
,
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
pOperator
->
fpSet
=
createOperatorFpSet
(
operatorDummyOpenFn
,
doStreamFill
,
NULL
,
destroyStreamFillOperatorInfo
,
NULL
);
code
=
appendDownstream
(
pOperator
,
&
downstream
,
1
);
if
(
code
!=
TSDB_CODE_SUCCESS
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录