Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
8fb78fd7
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看板
提交
8fb78fd7
编写于
10月 26, 2022
作者:
5
54liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
feat(stream):add ci
上级
78ff5f75
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
55 deletion
+39
-55
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+3
-55
tests/script/tsim/stream/distributeIntervalRetrive0.sim
tests/script/tsim/stream/distributeIntervalRetrive0.sim
+36
-0
未找到文件。
source/libs/executor/src/timewindowoperator.c
浏览文件 @
8fb78fd7
...
...
@@ -809,23 +809,6 @@ static int32_t savePullWindow(SPullWindowInfo* pPullInfo, SArray* pPullWins) {
return
TSDB_CODE_SUCCESS
;
}
int32_t
compareResKey
(
void
*
pKey
,
void
*
data
,
int32_t
index
)
{
SArray
*
res
=
(
SArray
*
)
data
;
SResKeyPos
*
pos
=
taosArrayGetP
(
res
,
index
);
SWinKey
*
pData
=
(
SWinKey
*
)
pKey
;
if
(
pData
->
ts
==
*
(
int64_t
*
)
pos
->
key
)
{
if
(
pData
->
groupId
>
pos
->
groupId
)
{
return
1
;
}
else
if
(
pData
->
groupId
<
pos
->
groupId
)
{
return
-
1
;
}
return
0
;
}
else
if
(
pData
->
ts
>
*
(
int64_t
*
)
pos
->
key
)
{
return
1
;
}
return
-
1
;
}
static
int32_t
saveResult
(
SResultWindowInfo
winInfo
,
SSHashObj
*
pStUpdated
)
{
winInfo
.
sessionWin
.
win
.
ekey
=
winInfo
.
sessionWin
.
win
.
skey
;
return
tSimpleHashPut
(
pStUpdated
,
&
winInfo
.
sessionWin
,
sizeof
(
SSessionKey
),
&
winInfo
,
sizeof
(
SResultWindowInfo
));
...
...
@@ -863,12 +846,6 @@ static void removeResults(SArray* pWins, SHashObj* pUpdatedMap) {
}
}
int64_t
getWinReskey
(
void
*
data
,
int32_t
index
)
{
SArray
*
res
=
(
SArray
*
)
data
;
SWinKey
*
pos
=
taosArrayGet
(
res
,
index
);
return
pos
->
ts
;
}
int32_t
compareWinRes
(
void
*
pKey
,
void
*
data
,
int32_t
index
)
{
SArray
*
res
=
(
SArray
*
)
data
;
SWinKey
*
pos
=
taosArrayGet
(
res
,
index
);
...
...
@@ -1307,27 +1284,6 @@ static SSDataBlock* doBuildIntervalResult(SOperatorInfo* pOperator) {
}
}
// todo merged with the build group result.
static
void
finalizeUpdatedResult
(
int32_t
numOfOutput
,
SDiskbasedBuf
*
pBuf
,
SArray
*
pUpdateList
,
int32_t
*
rowEntryInfoOffset
)
{
size_t
num
=
taosArrayGetSize
(
pUpdateList
);
for
(
int32_t
i
=
0
;
i
<
num
;
++
i
)
{
SResKeyPos
*
pPos
=
taosArrayGetP
(
pUpdateList
,
i
);
SFilePage
*
bufPage
=
getBufPage
(
pBuf
,
pPos
->
pos
.
pageId
);
SResultRow
*
pRow
=
(
SResultRow
*
)((
char
*
)
bufPage
+
pPos
->
pos
.
offset
);
for
(
int32_t
j
=
0
;
j
<
numOfOutput
;
++
j
)
{
SResultRowEntryInfo
*
pEntry
=
getResultEntryInfo
(
pRow
,
j
,
rowEntryInfoOffset
);
if
(
pRow
->
numOfRows
<
pEntry
->
numOfRes
)
{
pRow
->
numOfRows
=
pEntry
->
numOfRes
;
}
}
releaseBufPage
(
pBuf
,
bufPage
);
}
}
static
void
setInverFunction
(
SqlFunctionCtx
*
pCtx
,
int32_t
num
,
EStreamType
type
)
{
for
(
int
i
=
0
;
i
<
num
;
i
++
)
{
if
(
type
==
STREAM_INVERT
)
{
...
...
@@ -1578,16 +1534,6 @@ static void closeChildIntervalWindow(SOperatorInfo* pOperator, SArray* pChildren
}
}
static
void
freeAllPages
(
SArray
*
pageIds
,
SDiskbasedBuf
*
pDiskBuf
)
{
int32_t
size
=
taosArrayGetSize
(
pageIds
);
for
(
int32_t
i
=
0
;
i
<
size
;
i
++
)
{
int32_t
pageId
=
*
(
int32_t
*
)
taosArrayGet
(
pageIds
,
i
);
// SFilePage* bufPage = getBufPage(pDiskBuf, pageId);
// dBufSetBufPageRecycled(pDiskBuf, bufPage);
}
taosArrayClear
(
pageIds
);
}
static
void
doBuildDeleteResult
(
SStreamIntervalOperatorInfo
*
pInfo
,
SArray
*
pWins
,
int32_t
*
index
,
SSDataBlock
*
pBlock
)
{
blockDataCleanup
(
pBlock
);
...
...
@@ -3353,7 +3299,9 @@ SOperatorInfo* createStreamFinalIntervalOperatorInfo(SOperatorInfo* downstream,
.
calTrigger
=
pIntervalPhyNode
->
window
.
triggerType
,
.
maxTs
=
INT64_MIN
,
.
minTs
=
INT64_MAX
,
.
deleteMark
=
INT64_MAX
,
// for test 315360000000
.
deleteMark
=
1000LL
*
60LL
*
60LL
*
24LL
*
365LL
*
10LL
,
// .deleteMark = INT64_MAX,
};
ASSERT
(
pInfo
->
twAggSup
.
calTrigger
!=
STREAM_TRIGGER_MAX_DELAY
);
pInfo
->
primaryTsIndex
=
((
SColumnNode
*
)
pIntervalPhyNode
->
window
.
pTspk
)
->
slotId
;
...
...
tests/script/tsim/stream/distributeIntervalRetrive0.sim
浏览文件 @
8fb78fd7
...
...
@@ -236,7 +236,43 @@ endi
print loop3 over
sql drop stream if exists streams1;
sql drop database if exists test1;
sql create database test1 vgroups 4 keep 7000;
sql use test1;
sql create stable st(ts timestamp,a int,b int,c int) tags(ta int,tb int,tc int);
sql create table t1 using st tags(1,1,1);
sql create table t2 using st tags(2,2,2);
sql create stream streams1 trigger at_once into streamt1 as select _wstart as c0, count(*) c1, count(a) c2 from st interval(10s) ;
sql insert into t1 values(1648791211000,1,2,3);
sql insert into t1 values(1262275200000,2,2,3);
sql insert into t2 values(1262275200000,1,2,3);
$loop_count = 0
loop4:
sleep 300
sql select * from streamt1 order by c0;
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
# row 0
if $rows != 2 then
print =====loop4=rows=$rows
goto loop4
endi
if $data01 != 2 then
print =====loop4=data11=$data11
goto loop4
endi
print loop4 over
#==system sh/exec.sh -n dnode1 -s stop -x SIGINT
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录