Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
3f38d56c
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
3f38d56c
编写于
2月 14, 2023
作者:
5
54liuyao
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix:number of ssdatablock rows exceeds the capacity
上级
fcd17325
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
247 addition
and
15 deletion
+247
-15
source/libs/executor/src/filloperator.c
source/libs/executor/src/filloperator.c
+22
-15
tests/script/tsim/stream/fillIntervalRange.sim
tests/script/tsim/stream/fillIntervalRange.sim
+225
-0
未找到文件。
source/libs/executor/src/filloperator.c
浏览文件 @
3f38d56c
...
...
@@ -832,10 +832,13 @@ static bool checkResult(SStreamFillSupporter* pFillSup, TSKEY ts, uint64_t group
return
true
;
}
static
void
buildFillResult
(
SResultRowData
*
pResRow
,
SStreamFillSupporter
*
pFillSup
,
TSKEY
ts
,
SSDataBlock
*
pBlock
)
{
static
bool
buildFillResult
(
SResultRowData
*
pResRow
,
SStreamFillSupporter
*
pFillSup
,
TSKEY
ts
,
SSDataBlock
*
pBlock
)
{
if
(
pBlock
->
info
.
rows
>=
pBlock
->
info
.
capacity
)
{
return
false
;
}
uint64_t
groupId
=
pBlock
->
info
.
id
.
groupId
;
if
(
pFillSup
->
hasDelete
&&
!
checkResult
(
pFillSup
,
ts
,
groupId
))
{
return
;
return
true
;
}
for
(
int32_t
i
=
0
;
i
<
pFillSup
->
numOfAllCols
;
++
i
)
{
SFillColInfo
*
pFillCol
=
pFillSup
->
pAllColInfo
+
i
;
...
...
@@ -853,6 +856,7 @@ static void buildFillResult(SResultRowData* pResRow, SStreamFillSupporter* pFill
}
}
pBlock
->
info
.
rows
++
;
return
true
;
}
static
bool
hasRemainCalc
(
SStreamFillInfo
*
pFillInfo
)
{
...
...
@@ -932,7 +936,9 @@ static void doStreamFillRange(SStreamFillInfo* pFillInfo, SStreamFillSupporter*
}
if
(
pFillInfo
->
pos
==
FILL_POS_START
)
{
buildFillResult
(
&
pFillSup
->
cur
,
pFillSup
,
pFillSup
->
cur
.
key
,
pRes
);
if
(
buildFillResult
(
&
pFillSup
->
cur
,
pFillSup
,
pFillSup
->
cur
.
key
,
pRes
))
{
pFillInfo
->
pos
=
FILL_POS_INVALID
;
}
}
if
(
pFillInfo
->
type
!=
TSDB_FILL_LINEAR
)
{
doStreamFillNormal
(
pFillSup
,
pFillInfo
,
pRes
);
...
...
@@ -940,7 +946,9 @@ static void doStreamFillRange(SStreamFillInfo* pFillInfo, SStreamFillSupporter*
doStreamFillLinear
(
pFillSup
,
pFillInfo
,
pRes
);
if
(
pFillInfo
->
pos
==
FILL_POS_MID
)
{
buildFillResult
(
&
pFillSup
->
cur
,
pFillSup
,
pFillSup
->
cur
.
key
,
pRes
);
if
(
buildFillResult
(
&
pFillSup
->
cur
,
pFillSup
,
pFillSup
->
cur
.
key
,
pRes
))
{
pFillInfo
->
pos
=
FILL_POS_INVALID
;
}
}
if
(
pFillInfo
->
current
>
pFillInfo
->
end
&&
pFillInfo
->
pLinearInfo
->
hasNext
)
{
...
...
@@ -954,7 +962,9 @@ static void doStreamFillRange(SStreamFillInfo* pFillInfo, SStreamFillSupporter*
}
}
if
(
pFillInfo
->
pos
==
FILL_POS_END
)
{
buildFillResult
(
&
pFillSup
->
cur
,
pFillSup
,
pFillSup
->
cur
.
key
,
pRes
);
if
(
buildFillResult
(
&
pFillSup
->
cur
,
pFillSup
,
pFillSup
->
cur
.
key
,
pRes
))
{
pFillInfo
->
pos
=
FILL_POS_INVALID
;
}
}
}
...
...
@@ -989,10 +999,6 @@ static void doStreamFillImpl(SOperatorInfo* pOperator) {
uint64_t
groupId
=
pBlock
->
info
.
id
.
groupId
;
SSDataBlock
*
pRes
=
pInfo
->
pRes
;
pRes
->
info
.
id
.
groupId
=
groupId
;
if
(
hasRemainCalc
(
pFillInfo
))
{
doStreamFillRange
(
pFillInfo
,
pFillSup
,
pRes
);
}
SColumnInfoData
*
pTsCol
=
taosArrayGet
(
pInfo
->
pSrcBlock
->
pDataBlock
,
pInfo
->
primaryTsCol
);
TSKEY
*
tsCol
=
(
TSKEY
*
)
pTsCol
->
pData
;
...
...
@@ -1204,13 +1210,14 @@ static SSDataBlock* doStreamFill(SOperatorInfo* pOperator) {
return
NULL
;
}
blockDataCleanup
(
pInfo
->
pRes
);
if
(
pOperator
->
status
==
OP_RES_TO_RETURN
)
{
if
(
hasRemainCalc
(
pInfo
->
pFillInfo
))
{
if
(
hasRemainCalc
(
pInfo
->
pFillInfo
)
||
(
pInfo
->
pFillInfo
->
pos
!=
FILL_POS_INVALID
&&
pInfo
->
pFillInfo
->
needFill
==
true
))
{
doStreamFillRange
(
pInfo
->
pFillInfo
,
pInfo
->
pFillSup
,
pInfo
->
pRes
);
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
printDataBlock
(
pInfo
->
pRes
,
"stream fill"
);
return
pInfo
->
pRes
;
}
}
if
(
pOperator
->
status
==
OP_RES_TO_RETURN
)
{
doDeleteFillFinalize
(
pOperator
);
if
(
pInfo
->
pRes
->
info
.
rows
>
0
)
{
printDataBlock
(
pInfo
->
pRes
,
"stream fill"
);
...
...
tests/script/tsim/stream/fillIntervalRange.sim
0 → 100644
浏览文件 @
3f38d56c
$loop_all = 0
looptest:
system sh/stop_dnodes.sh
system sh/deploy.sh -n dnode1 -i 1
system sh/exec.sh -n dnode1 -s start
sleep 500
sql connect
sql drop database if exists test;
sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));;
sql create stream streams1 trigger at_once into streamt as select _wstart ts, count(*) c1 from t1 interval(1s) fill(NULL);
sql insert into t1 values(1648791211000,1,2,3,1.0,'aaa');
sleep 100
sql insert into t1 values(1648795308000,1,2,3,1.0,'aaa');
$loop_count = 0
loop0:
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sleep 500
sql select * from streamt where c1 > 0;
if $rows != 2 then
print =====rows=$rows
goto loop0
endi
sql select count(*) from streamt;
if $data00 != 4098 then
print =====data00=$data00
goto loop0
endi
sql insert into t1 values(1648800308000,1,1,1,1.0,'aaa');
$loop_count = 0
loop1:
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sleep 500
sql select * from streamt where c1 > 0;
if $rows != 3 then
print =====rows=$rows
goto loop1
endi
sql select count(*) from streamt;
if $data00 != 9098 then
print =====rows=$rows
goto loop1
endi
sql insert into t1 values(1648786211000,1,1,1,1.0,'aaa');
$loop_count = 0
loop2:
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sleep 500
sql select * from streamt where c1 > 0;
if $rows != 4 then
print =====rows=$rows
goto loop2
endi
sql select count(*) from streamt;
if $data00 != 14098 then
print =====rows=$rows
goto loop2
endi
sql insert into t1 values(1648801308000,1,1,1,1.0,'aaa') (1648802308000,1,1,1,1.0,'aaa') (1648803308000,1,1,1,1.0,'aaa') (1648804308000,1,1,1,1.0,'aaa') (1648805308000,1,1,1,1.0,'aaa');
$loop_count = 0
loop21:
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sleep 500
sql select * from streamt where c1 > 0;
if $rows != 9 then
print =====rows=$rows
goto loop21
endi
sql select count(*) from streamt;
if $data00 != 19098 then
print =====rows=$rows
goto loop21
endi
sql drop database if exists test;
sql create database test vgroups 1;
sql use test;
sql create table t1(ts timestamp, a int, b int , c int, d double, s varchar(20));
print create stream streams1 trigger at_once into streamt as select _wstart ts, max(a) c1 from t1 interval(1s) fill(linear);
sql create stream streams1 trigger at_once into streamt as select _wstart ts, max(a) c1 from t1 interval(1s) fill(linear);
print create stream streams2 trigger at_once into streamt2 as select _wstart ts, max(a) c1 from t1 interval(1s) fill(prev);
sql create stream streams2 trigger at_once into streamt2 as select _wstart ts, max(a) c1 from t1 interval(1s) fill(prev);
sql insert into t1 values(1648791211000,1,2,3,1.0,'aaa');
sleep 100
sql insert into t1 values(1648795308000,1,2,3,1.0,'aaa');
$loop_count = 0
loop3:
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sleep 500
print select count(*) from streamt;
sql select count(*) from streamt;
if $data00 != 4098 then
print =====data00=$data00
goto loop3
endi
print select count(*) from streamt2;
sql select count(*) from streamt2;
if $data00 != 4098 then
print =====data00=$data00
goto loop3
endi
sql insert into t1 values(1648800308000,1,1,1,1.0,'aaa');
$loop_count = 0
loop4:
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sleep 500
print select count(*) from streamt;
sql select count(*) from streamt;
if $data00 != 9098 then
print =====rows=$rows
goto loop4
endi
print select count(*) from streamt2;
sql select count(*) from streamt2;
if $data00 != 9098 then
print =====rows=$rows
goto loop4
endi
sql insert into t1 values(1648786211000,1,1,1,1.0,'aaa');
$loop_count = 0
loop5:
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sleep 500
print select count(*) from streamt;
sql select count(*) from streamt;
if $data00 != 14098 then
print =====rows=$rows
goto loop5
endi
print select count(*) from streamt2;
sql select count(*) from streamt2;
if $data00 != 14098 then
print =====rows=$rows
goto loop5
endi
system sh/stop_dnodes.sh
#goto looptest
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录