Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
f2364579
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看板
提交
f2364579
编写于
4月 10, 2023
作者:
L
liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat:add data version
上级
9a1b2a6d
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
19 addition
and
3 deletion
+19
-3
source/libs/executor/inc/executorimpl.h
source/libs/executor/inc/executorimpl.h
+4
-3
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+15
-0
未找到文件。
source/libs/executor/inc/executorimpl.h
浏览文件 @
f2364579
...
@@ -142,9 +142,7 @@ typedef struct {
...
@@ -142,9 +142,7 @@ typedef struct {
SQueryTableDataCond
tableCond
;
SQueryTableDataCond
tableCond
;
int64_t
fillHistoryVer1
;
int64_t
fillHistoryVer1
;
int64_t
fillHistoryVer2
;
int64_t
fillHistoryVer2
;
int64_t
dataVersion
;
// int8_t triggerSaved;
// int64_t deleteMarkSaved;
SStreamState
*
pState
;
SStreamState
*
pState
;
}
SStreamTaskInfo
;
}
SStreamTaskInfo
;
...
@@ -575,6 +573,7 @@ typedef struct SStreamIntervalOperatorInfo {
...
@@ -575,6 +573,7 @@ typedef struct SStreamIntervalOperatorInfo {
uint64_t
numOfDatapack
;
uint64_t
numOfDatapack
;
SArray
*
pUpdated
;
SArray
*
pUpdated
;
SSHashObj
*
pUpdatedMap
;
SSHashObj
*
pUpdatedMap
;
int64_t
dataVersion
;
}
SStreamIntervalOperatorInfo
;
}
SStreamIntervalOperatorInfo
;
typedef
struct
SDataGroupInfo
{
typedef
struct
SDataGroupInfo
{
...
@@ -623,6 +622,7 @@ typedef struct SStreamSessionAggOperatorInfo {
...
@@ -623,6 +622,7 @@ typedef struct SStreamSessionAggOperatorInfo {
bool
ignoreExpiredData
;
bool
ignoreExpiredData
;
SArray
*
pUpdated
;
SArray
*
pUpdated
;
SSHashObj
*
pStUpdated
;
SSHashObj
*
pStUpdated
;
int64_t
dataVersion
;
}
SStreamSessionAggOperatorInfo
;
}
SStreamSessionAggOperatorInfo
;
typedef
struct
SStreamStateAggOperatorInfo
{
typedef
struct
SStreamStateAggOperatorInfo
{
...
@@ -640,6 +640,7 @@ typedef struct SStreamStateAggOperatorInfo {
...
@@ -640,6 +640,7 @@ typedef struct SStreamStateAggOperatorInfo {
bool
ignoreExpiredData
;
bool
ignoreExpiredData
;
SArray
*
pUpdated
;
SArray
*
pUpdated
;
SSHashObj
*
pSeUpdated
;
SSHashObj
*
pSeUpdated
;
int64_t
dataVersion
;
}
SStreamStateAggOperatorInfo
;
}
SStreamStateAggOperatorInfo
;
typedef
struct
SStreamPartitionOperatorInfo
{
typedef
struct
SStreamPartitionOperatorInfo
{
...
...
source/libs/executor/src/timewindowoperator.c
浏览文件 @
f2364579
...
@@ -2409,9 +2409,14 @@ static int32_t getNextQualifiedFinalWindow(SInterval* pInterval, STimeWindow* pN
...
@@ -2409,9 +2409,14 @@ static int32_t getNextQualifiedFinalWindow(SInterval* pInterval, STimeWindow* pN
return
startPos
;
return
startPos
;
}
}
static
void
setStreamDataVersion
(
SExecTaskInfo
*
pTaskInfo
,
int64_t
version
)
{
pTaskInfo
->
streamInfo
.
dataVersion
=
version
;
}
static
void
doStreamIntervalAggImpl
(
SOperatorInfo
*
pOperatorInfo
,
SSDataBlock
*
pSDataBlock
,
uint64_t
groupId
,
static
void
doStreamIntervalAggImpl
(
SOperatorInfo
*
pOperatorInfo
,
SSDataBlock
*
pSDataBlock
,
uint64_t
groupId
,
SSHashObj
*
pUpdatedMap
)
{
SSHashObj
*
pUpdatedMap
)
{
SStreamIntervalOperatorInfo
*
pInfo
=
(
SStreamIntervalOperatorInfo
*
)
pOperatorInfo
->
info
;
SStreamIntervalOperatorInfo
*
pInfo
=
(
SStreamIntervalOperatorInfo
*
)
pOperatorInfo
->
info
;
pInfo
->
dataVersion
=
TMAX
(
pInfo
->
dataVersion
,
pSDataBlock
->
info
.
version
);
SResultRowInfo
*
pResultRowInfo
=
&
(
pInfo
->
binfo
.
resultRowInfo
);
SResultRowInfo
*
pResultRowInfo
=
&
(
pInfo
->
binfo
.
resultRowInfo
);
SExecTaskInfo
*
pTaskInfo
=
pOperatorInfo
->
pTaskInfo
;
SExecTaskInfo
*
pTaskInfo
=
pOperatorInfo
->
pTaskInfo
;
...
@@ -2599,6 +2604,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
...
@@ -2599,6 +2604,7 @@ static SSDataBlock* doStreamFinalIntervalAgg(SOperatorInfo* pOperator) {
clearFunctionContext
(
&
pOperator
->
exprSupp
);
clearFunctionContext
(
&
pOperator
->
exprSupp
);
// semi interval operator clear disk buffer
// semi interval operator clear disk buffer
clearStreamIntervalOperator
(
pInfo
);
clearStreamIntervalOperator
(
pInfo
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
);
qDebug
(
"===stream===clear semi operator"
);
qDebug
(
"===stream===clear semi operator"
);
}
else
{
}
else
{
deleteIntervalDiscBuf
(
pInfo
->
pState
,
pInfo
->
pPullDataMap
,
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
deleteMark
,
deleteIntervalDiscBuf
(
pInfo
->
pState
,
pInfo
->
pPullDataMap
,
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
deleteMark
,
...
@@ -2883,6 +2889,7 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream,
...
@@ -2883,6 +2889,7 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream,
pInfo
->
pUpdatedMap
=
NULL
;
pInfo
->
pUpdatedMap
=
NULL
;
pInfo
->
pState
->
pFileState
=
streamFileStateInit
(
tsStreamBufferSize
,
sizeof
(
SWinKey
),
pInfo
->
aggSup
.
resultRowSize
,
compareTs
,
pInfo
->
pState
->
pFileState
=
streamFileStateInit
(
tsStreamBufferSize
,
sizeof
(
SWinKey
),
pInfo
->
aggSup
.
resultRowSize
,
compareTs
,
pInfo
->
pState
,
pInfo
->
twAggSup
.
deleteMark
);
pInfo
->
pState
,
pInfo
->
twAggSup
.
deleteMark
);
pInfo
->
dataVersion
=
0
;
pOperator
->
operatorType
=
pPhyNode
->
type
;
pOperator
->
operatorType
=
pPhyNode
->
type
;
pOperator
->
blocking
=
true
;
pOperator
->
blocking
=
true
;
...
@@ -3233,6 +3240,8 @@ static void doStreamSessionAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSData
...
@@ -3233,6 +3240,8 @@ static void doStreamSessionAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSData
int32_t
rows
=
pSDataBlock
->
info
.
rows
;
int32_t
rows
=
pSDataBlock
->
info
.
rows
;
int32_t
winRows
=
0
;
int32_t
winRows
=
0
;
pInfo
->
dataVersion
=
TMAX
(
pInfo
->
dataVersion
,
pSDataBlock
->
info
.
version
);
SColumnInfoData
*
pStartTsCol
=
taosArrayGet
(
pSDataBlock
->
pDataBlock
,
pInfo
->
primaryTsIndex
);
SColumnInfoData
*
pStartTsCol
=
taosArrayGet
(
pSDataBlock
->
pDataBlock
,
pInfo
->
primaryTsIndex
);
TSKEY
*
startTsCols
=
(
int64_t
*
)
pStartTsCol
->
pData
;
TSKEY
*
startTsCols
=
(
int64_t
*
)
pStartTsCol
->
pData
;
SColumnInfoData
*
pEndTsCol
=
NULL
;
SColumnInfoData
*
pEndTsCol
=
NULL
;
...
@@ -3695,6 +3704,7 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh
...
@@ -3695,6 +3704,7 @@ SOperatorInfo* createStreamSessionAggOperatorInfo(SOperatorInfo* downstream, SPh
pInfo
->
ignoreExpiredData
=
pSessionNode
->
window
.
igExpired
;
pInfo
->
ignoreExpiredData
=
pSessionNode
->
window
.
igExpired
;
pInfo
->
pUpdated
=
NULL
;
pInfo
->
pUpdated
=
NULL
;
pInfo
->
pStUpdated
=
NULL
;
pInfo
->
pStUpdated
=
NULL
;
pInfo
->
dataVersion
=
0
;
setOperatorInfo
(
pOperator
,
"StreamSessionWindowAggOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION
,
true
,
setOperatorInfo
(
pOperator
,
"StreamSessionWindowAggOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_SESSION
,
true
,
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
...
@@ -4005,6 +4015,9 @@ static void doStreamStateAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBl
...
@@ -4005,6 +4015,9 @@ static void doStreamStateAggImpl(SOperatorInfo* pOperator, SSDataBlock* pSDataBl
TSKEY
*
tsCols
=
NULL
;
TSKEY
*
tsCols
=
NULL
;
SResultRow
*
pResult
=
NULL
;
SResultRow
*
pResult
=
NULL
;
int32_t
winRows
=
0
;
int32_t
winRows
=
0
;
pInfo
->
dataVersion
=
TMAX
(
pInfo
->
dataVersion
,
pSDataBlock
->
info
.
version
);
if
(
pSDataBlock
->
pDataBlock
!=
NULL
)
{
if
(
pSDataBlock
->
pDataBlock
!=
NULL
)
{
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pSDataBlock
->
pDataBlock
,
pInfo
->
primaryTsIndex
);
SColumnInfoData
*
pColDataInfo
=
taosArrayGet
(
pSDataBlock
->
pDataBlock
,
pInfo
->
primaryTsIndex
);
tsCols
=
(
int64_t
*
)
pColDataInfo
->
pData
;
tsCols
=
(
int64_t
*
)
pColDataInfo
->
pData
;
...
@@ -4220,6 +4233,7 @@ SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhys
...
@@ -4220,6 +4233,7 @@ SOperatorInfo* createStreamStateAggOperatorInfo(SOperatorInfo* downstream, SPhys
pInfo
->
ignoreExpiredData
=
pStateNode
->
window
.
igExpired
;
pInfo
->
ignoreExpiredData
=
pStateNode
->
window
.
igExpired
;
pInfo
->
pUpdated
=
NULL
;
pInfo
->
pUpdated
=
NULL
;
pInfo
->
pSeUpdated
=
NULL
;
pInfo
->
pSeUpdated
=
NULL
;
pInfo
->
dataVersion
=
0
;
setOperatorInfo
(
pOperator
,
"StreamStateAggOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE
,
true
,
OP_NOT_OPENED
,
setOperatorInfo
(
pOperator
,
"StreamStateAggOperator"
,
QUERY_NODE_PHYSICAL_PLAN_STREAM_STATE
,
true
,
OP_NOT_OPENED
,
pInfo
,
pTaskInfo
);
pInfo
,
pTaskInfo
);
...
@@ -4856,6 +4870,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
...
@@ -4856,6 +4870,7 @@ static SSDataBlock* doStreamIntervalAgg(SOperatorInfo* pOperator) {
setOperatorCompleted
(
pOperator
);
setOperatorCompleted
(
pOperator
);
if
(
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
checkPointInterval
>
pInfo
->
twAggSup
.
checkPointTs
)
{
if
(
pInfo
->
twAggSup
.
maxTs
-
pInfo
->
twAggSup
.
checkPointInterval
>
pInfo
->
twAggSup
.
checkPointTs
)
{
streamStateCommit
(
pInfo
->
pState
);
streamStateCommit
(
pInfo
->
pState
);
setStreamDataVersion
(
pTaskInfo
,
pInfo
->
dataVersion
);
pInfo
->
twAggSup
.
checkPointTs
=
pInfo
->
twAggSup
.
maxTs
;
pInfo
->
twAggSup
.
checkPointTs
=
pInfo
->
twAggSup
.
maxTs
;
}
}
return
NULL
;
return
NULL
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录