Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
327e13c3
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看板
提交
327e13c3
编写于
8月 08, 2023
作者:
H
Haojun Liao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix(stream): fix the syntax error.
上级
d6d63ec5
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
4 addition
and
83 deletion
+4
-83
source/libs/executor/src/scanoperator.c
source/libs/executor/src/scanoperator.c
+4
-77
source/libs/stream/src/streamRecover.c
source/libs/stream/src/streamRecover.c
+0
-6
未找到文件。
source/libs/executor/src/scanoperator.c
浏览文件 @
327e13c3
...
...
@@ -1754,7 +1754,8 @@ static SSDataBlock* doQueueScan(SOperatorInfo* pOperator) {
qDebug
(
"doQueueScan get data from log %"
PRId64
" rows, version:%"
PRId64
,
pRes
->
info
.
rows
,
pTaskInfo
->
streamInfo
.
currentOffset
.
version
);
blockDataCleanup
(
pInfo
->
pRes
);
setBlockIntoRes
(
pInfo
,
pRes
,
true
);
STimeWindow
defaultWindow
=
{.
skey
=
INT64_MIN
,
.
ekey
=
INT64_MAX
};
setBlockIntoRes
(
pInfo
,
pRes
,
&
defaultWindow
,
true
);
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
return
pInfo
->
pRes
;
}
...
...
@@ -1863,80 +1864,6 @@ void streamScanOperatorDecode(void* pBuff, int32_t len, SStreamScanInfo* pInfo)
}
}
static
void
doBlockDataWindowFilter
(
SSDataBlock
*
pBlock
,
int32_t
tsIndex
,
STimeWindow
*
pWindow
,
const
char
*
id
)
{
if
(
pWindow
->
skey
!=
INT64_MIN
||
pWindow
->
ekey
!=
INT64_MAX
)
{
bool
*
p
=
taosMemoryCalloc
(
pBlock
->
info
.
rows
,
sizeof
(
bool
));
bool
hasUnqualified
=
false
;
SColumnInfoData
*
pCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
tsIndex
);
if
(
pWindow
->
skey
!=
INT64_MIN
)
{
qDebug
(
"%s filter for additional history window, skey:%"
PRId64
,
id
,
pWindow
->
skey
);
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
rows
;
++
i
)
{
int64_t
*
ts
=
(
int64_t
*
)
colDataGetData
(
pCol
,
i
);
p
[
i
]
=
(
*
ts
>=
pWindow
->
skey
);
if
(
!
p
[
i
])
{
hasUnqualified
=
true
;
}
}
}
else
if
(
pWindow
->
ekey
!=
INT64_MAX
)
{
qDebug
(
"%s filter for additional history window, ekey:%"
PRId64
,
id
,
pWindow
->
ekey
);
for
(
int32_t
i
=
0
;
i
<
pBlock
->
info
.
rows
;
++
i
)
{
int64_t
*
ts
=
(
int64_t
*
)
colDataGetData
(
pCol
,
i
);
p
[
i
]
=
(
*
ts
<=
pWindow
->
ekey
);
if
(
!
p
[
i
])
{
hasUnqualified
=
true
;
}
}
}
if
(
hasUnqualified
)
{
trimDataBlock
(
pBlock
,
pBlock
->
info
.
rows
,
p
);
}
taosMemoryFree
(
p
);
}
}
// re-build the delete block, ONLY according to the split timestamp
static
void
rebuildDeleteBlockData
(
SSDataBlock
*
pBlock
,
int64_t
skey
,
const
char
*
id
)
{
if
(
skey
==
INT64_MIN
)
{
return
;
}
int32_t
numOfRows
=
pBlock
->
info
.
rows
;
bool
*
p
=
taosMemoryCalloc
(
numOfRows
,
sizeof
(
bool
));
bool
hasUnqualified
=
false
;
SColumnInfoData
*
pSrcStartCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
START_TS_COLUMN_INDEX
);
uint64_t
*
tsStartCol
=
(
uint64_t
*
)
pSrcStartCol
->
pData
;
SColumnInfoData
*
pSrcEndCol
=
taosArrayGet
(
pBlock
->
pDataBlock
,
END_TS_COLUMN_INDEX
);
uint64_t
*
tsEndCol
=
(
uint64_t
*
)
pSrcEndCol
->
pData
;
for
(
int32_t
i
=
0
;
i
<
numOfRows
;
i
++
)
{
if
(
tsStartCol
[
i
]
<
skey
)
{
tsStartCol
[
i
]
=
skey
;
}
if
(
tsEndCol
[
i
]
>=
skey
)
{
p
[
i
]
=
true
;
}
else
{
// this row should be removed, since it is not in this query time window, which is [skey, INT64_MAX]
hasUnqualified
=
true
;
}
}
if
(
hasUnqualified
)
{
trimDataBlock
(
pBlock
,
pBlock
->
info
.
rows
,
p
);
}
qDebug
(
"%s re-build delete datablock, start key revised to:%"
PRId64
", rows:%"
PRId64
,
id
,
skey
,
pBlock
->
info
.
rows
);
taosMemoryFree
(
p
);
}
static
SSDataBlock
*
doStreamScan
(
SOperatorInfo
*
pOperator
)
{
// NOTE: this operator does never check if current status is done or not
SExecTaskInfo
*
pTaskInfo
=
pOperator
->
pTaskInfo
;
...
...
@@ -2109,7 +2036,7 @@ FETCH_NEXT_BLOCK:
}
setBlockGroupIdByUid
(
pInfo
,
pDelBlock
);
rebuildDeleteBlockData
(
pDelBlock
,
pStreamInfo
->
fillHistoryWindow
.
skey
,
id
);
rebuildDeleteBlockData
(
pDelBlock
,
&
pStreamInfo
->
fillHistoryWindow
,
id
);
printDataBlock
(
pDelBlock
,
"stream scan delete recv filtered"
);
if
(
pDelBlock
->
info
.
rows
==
0
)
{
if
(
pInfo
->
tqReader
)
{
...
...
@@ -2254,7 +2181,7 @@ FETCH_NEXT_BLOCK:
continue
;
}
setBlockIntoRes
(
pInfo
,
pRes
,
false
);
setBlockIntoRes
(
pInfo
,
pRes
,
&
pStreamInfo
->
fillHistoryWindow
,
false
);
if
(
pInfo
->
pCreateTbRes
->
info
.
rows
>
0
)
{
pInfo
->
scanMode
=
STREAM_SCAN_FROM_RES
;
qDebug
(
"create table res exists, rows:%"
PRId64
" return from stream scan, %s"
,
pInfo
->
pCreateTbRes
->
info
.
rows
,
id
);
...
...
source/libs/stream/src/streamRecover.c
浏览文件 @
327e13c3
...
...
@@ -492,12 +492,6 @@ int32_t streamProcessScanHistoryFinishReq(SStreamTask* pTask, SStreamScanHistory
return
0
;
}
int32_t
streamTaskFillHistoryFinished
(
SStreamTask
*
pTask
)
{
void
*
exec
=
pTask
->
exec
.
pExecutor
;
qResetStreamInfoTimeWindow
(
exec
);
return
0
;
}
int32_t
streamProcessScanHistoryFinishRsp
(
SStreamTask
*
pTask
)
{
ASSERT
(
pTask
->
status
.
taskStatus
==
TASK_STATUS__SCAN_HISTORY
);
SStreamMeta
*
pMeta
=
pTask
->
pMeta
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录