Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
57a020ed
T
TDengine
项目概览
taosdata
/
TDengine
大约 2 年 前同步成功
通知
1193
Star
22018
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看板
提交
57a020ed
编写于
8月 14, 2023
作者:
L
liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refact stream interval
上级
9d1e5a51
变更
7
展开全部
隐藏空白更改
内联
并排
Showing
7 changed file
with
3297 addition
and
3312 deletion
+3297
-3312
source/libs/executor/inc/executil.h
source/libs/executor/inc/executil.h
+3
-0
source/libs/executor/inc/executorInt.h
source/libs/executor/inc/executorInt.h
+7
-0
source/libs/executor/src/eventwindowoperator.c
source/libs/executor/src/eventwindowoperator.c
+1
-11
source/libs/executor/src/executil.c
source/libs/executor/src/executil.c
+11
-0
source/libs/executor/src/executorInt.c
source/libs/executor/src/executorInt.c
+12
-0
source/libs/executor/src/streamtimewindowoperator.c
source/libs/executor/src/streamtimewindowoperator.c
+3232
-0
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+31
-3301
未找到文件。
source/libs/executor/inc/executil.h
浏览文件 @
57a020ed
...
@@ -190,4 +190,7 @@ void printDataBlock(SSDataBlock* pBlock, const char* flag, const char* taskIdStr
...
@@ -190,4 +190,7 @@ void printDataBlock(SSDataBlock* pBlock, const char* flag, const char* taskIdStr
void
getNextTimeWindow
(
const
SInterval
*
pInterval
,
STimeWindow
*
tw
,
int32_t
order
);
void
getNextTimeWindow
(
const
SInterval
*
pInterval
,
STimeWindow
*
tw
,
int32_t
order
);
void
getInitialStartTimeWindow
(
SInterval
*
pInterval
,
TSKEY
ts
,
STimeWindow
*
w
,
bool
ascQuery
);
void
getInitialStartTimeWindow
(
SInterval
*
pInterval
,
TSKEY
ts
,
STimeWindow
*
w
,
bool
ascQuery
);
TSKEY
getStartTsKey
(
STimeWindow
*
win
,
const
TSKEY
*
tsCols
);
void
updateTimeWindowInfo
(
SColumnInfoData
*
pColData
,
STimeWindow
*
pWin
,
int64_t
delta
);
#endif // TDENGINE_EXECUTIL_H
#endif // TDENGINE_EXECUTIL_H
source/libs/executor/inc/executorInt.h
浏览文件 @
57a020ed
...
@@ -695,6 +695,13 @@ uint64_t calcGroupId(char* pData, int32_t len);
...
@@ -695,6 +695,13 @@ uint64_t calcGroupId(char* pData, int32_t len);
void
streamOpReleaseState
(
struct
SOperatorInfo
*
pOperator
);
void
streamOpReleaseState
(
struct
SOperatorInfo
*
pOperator
);
void
streamOpReloadState
(
struct
SOperatorInfo
*
pOperator
);
void
streamOpReloadState
(
struct
SOperatorInfo
*
pOperator
);
bool
inSlidingWindow
(
SInterval
*
pInterval
,
STimeWindow
*
pWin
,
SDataBlockInfo
*
pBlockInfo
);
bool
inCalSlidingWindow
(
SInterval
*
pInterval
,
STimeWindow
*
pWin
,
TSKEY
calStart
,
TSKEY
calEnd
,
EStreamType
blockType
);
bool
compareVal
(
const
char
*
v
,
const
SStateKeys
*
pKey
);
int32_t
getNextQualifiedWindow
(
SInterval
*
pInterval
,
STimeWindow
*
pNext
,
SDataBlockInfo
*
pDataBlockInfo
,
TSKEY
*
primaryKeys
,
int32_t
prevPosition
,
int32_t
order
);
#ifdef __cplusplus
#ifdef __cplusplus
}
}
#endif
#endif
...
...
source/libs/executor/src/eventwindowoperator.c
浏览文件 @
57a020ed
...
@@ -58,16 +58,6 @@ static void doKeepTuple(SWindowRowsSup* pRowSup, int64_t ts, uint64_t groupId) {
...
@@ -58,16 +58,6 @@ static void doKeepTuple(SWindowRowsSup* pRowSup, int64_t ts, uint64_t groupId) {
pRowSup
->
groupId
=
groupId
;
pRowSup
->
groupId
=
groupId
;
}
}
static
void
updateTimeWindowInfo
(
SColumnInfoData
*
pColData
,
STimeWindow
*
pWin
,
bool
includeEndpoint
)
{
int64_t
*
ts
=
(
int64_t
*
)
pColData
->
pData
;
int32_t
delta
=
includeEndpoint
?
1
:
0
;
int64_t
duration
=
pWin
->
ekey
-
pWin
->
skey
+
delta
;
ts
[
2
]
=
duration
;
// set the duration
ts
[
3
]
=
pWin
->
skey
;
// window start key
ts
[
4
]
=
pWin
->
ekey
+
delta
;
// window end key
}
SOperatorInfo
*
createEventwindowOperatorInfo
(
SOperatorInfo
*
downstream
,
SPhysiNode
*
physiNode
,
SOperatorInfo
*
createEventwindowOperatorInfo
(
SOperatorInfo
*
downstream
,
SPhysiNode
*
physiNode
,
SExecTaskInfo
*
pTaskInfo
)
{
SExecTaskInfo
*
pTaskInfo
)
{
SEventWindowOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SEventWindowOperatorInfo
));
SEventWindowOperatorInfo
*
pInfo
=
taosMemoryCalloc
(
1
,
sizeof
(
SEventWindowOperatorInfo
));
...
@@ -250,7 +240,7 @@ static void doEventWindowAggImpl(SEventWindowOperatorInfo* pInfo, SExprSupp* pSu
...
@@ -250,7 +240,7 @@ static void doEventWindowAggImpl(SEventWindowOperatorInfo* pInfo, SExprSupp* pSu
T_LONG_JMP
(
pTaskInfo
->
env
,
TSDB_CODE_APP_ERROR
);
T_LONG_JMP
(
pTaskInfo
->
env
,
TSDB_CODE_APP_ERROR
);
}
}
updateTimeWindowInfo
(
&
pInfo
->
twAggSup
.
timeWindowData
,
&
pRowSup
->
win
,
false
);
updateTimeWindowInfo
(
&
pInfo
->
twAggSup
.
timeWindowData
,
&
pRowSup
->
win
,
0
);
applyAggFunctionOnPartialTuples
(
pTaskInfo
,
pSup
->
pCtx
,
&
pInfo
->
twAggSup
.
timeWindowData
,
startIndex
,
numOfRows
,
applyAggFunctionOnPartialTuples
(
pTaskInfo
,
pSup
->
pCtx
,
&
pInfo
->
twAggSup
.
timeWindowData
,
startIndex
,
numOfRows
,
pBlock
->
info
.
rows
,
numOfOutput
);
pBlock
->
info
.
rows
,
numOfOutput
);
}
}
...
...
source/libs/executor/src/executil.c
浏览文件 @
57a020ed
...
@@ -2187,3 +2187,14 @@ void printDataBlock(SSDataBlock* pBlock, const char* flag, const char* taskIdStr
...
@@ -2187,3 +2187,14 @@ void printDataBlock(SSDataBlock* pBlock, const char* flag, const char* taskIdStr
qDebug
(
"%s"
,
dumpBlockData
(
pBlock
,
flag
,
&
pBuf
,
taskIdStr
));
qDebug
(
"%s"
,
dumpBlockData
(
pBlock
,
flag
,
&
pBuf
,
taskIdStr
));
taosMemoryFree
(
pBuf
);
taosMemoryFree
(
pBuf
);
}
}
TSKEY
getStartTsKey
(
STimeWindow
*
win
,
const
TSKEY
*
tsCols
)
{
return
tsCols
==
NULL
?
win
->
skey
:
tsCols
[
0
];
}
void
updateTimeWindowInfo
(
SColumnInfoData
*
pColData
,
STimeWindow
*
pWin
,
int64_t
delta
)
{
int64_t
*
ts
=
(
int64_t
*
)
pColData
->
pData
;
int64_t
duration
=
pWin
->
ekey
-
pWin
->
skey
+
delta
;
ts
[
2
]
=
duration
;
// set the duration
ts
[
3
]
=
pWin
->
skey
;
// window start key
ts
[
4
]
=
pWin
->
ekey
+
delta
;
// window end key
}
source/libs/executor/src/executorInt.c
浏览文件 @
57a020ed
...
@@ -1070,3 +1070,15 @@ void streamOpReloadState(SOperatorInfo* pOperator) {
...
@@ -1070,3 +1070,15 @@ void streamOpReloadState(SOperatorInfo* pOperator) {
downstream
->
fpSet
.
reloadStreamStateFn
(
downstream
);
downstream
->
fpSet
.
reloadStreamStateFn
(
downstream
);
}
}
}
}
bool
compareVal
(
const
char
*
v
,
const
SStateKeys
*
pKey
)
{
if
(
IS_VAR_DATA_TYPE
(
pKey
->
type
))
{
if
(
varDataLen
(
v
)
!=
varDataLen
(
pKey
->
pData
))
{
return
false
;
}
else
{
return
memcmp
(
varDataVal
(
v
),
varDataVal
(
pKey
->
pData
),
varDataLen
(
v
))
==
0
;
}
}
else
{
return
memcmp
(
pKey
->
pData
,
v
,
pKey
->
bytes
)
==
0
;
}
}
source/libs/executor/src/streamtimewindowoperator.c
0 → 100644
浏览文件 @
57a020ed
此差异已折叠。
点击以展开。
source/libs/executor/src/timewindowoperator.c
浏览文件 @
57a020ed
此差异已折叠。
点击以展开。
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录