Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
12cea405
T
TDengine
项目概览
taosdata
/
TDengine
大约 1 年 前同步成功
通知
1185
Star
22015
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看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
12cea405
编写于
1月 30, 2023
作者:
H
Haojun Liao
提交者:
GitHub
1月 30, 2023
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #19705 from taosdata/fix/TS-2499
fix:process data with incorrect timestamp
上级
c273c42d
1ce1f814
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
127 addition
and
12 deletion
+127
-12
source/libs/executor/src/timewindowoperator.c
source/libs/executor/src/timewindowoperator.c
+13
-1
tests/script/tsim/stream/basic1.sim
tests/script/tsim/stream/basic1.sim
+53
-0
tests/script/tsim/stream/triggerInterval0.sim
tests/script/tsim/stream/triggerInterval0.sim
+61
-11
未找到文件。
source/libs/executor/src/timewindowoperator.c
浏览文件 @
12cea405
...
...
@@ -2477,7 +2477,19 @@ static void doStreamIntervalAggImpl(SOperatorInfo* pOperatorInfo, SSDataBlock* p
pInfo
->
delKey
=
key
;
}
int32_t
prevEndPos
=
(
forwardRows
-
1
)
*
step
+
startPos
;
ASSERT
(
pSDataBlock
->
info
.
window
.
skey
>
0
&&
pSDataBlock
->
info
.
window
.
ekey
>
0
);
if
(
pSDataBlock
->
info
.
window
.
skey
<=
0
||
pSDataBlock
->
info
.
window
.
ekey
<=
0
)
{
qError
(
"table uid %"
PRIu64
" data block timestamp range may not be calculated! minKey %"
PRId64
",maxKey %"
PRId64
,
pSDataBlock
->
info
.
id
.
uid
,
pSDataBlock
->
info
.
window
.
skey
,
pSDataBlock
->
info
.
window
.
ekey
);
blockDataUpdateTsWindow
(
pSDataBlock
,
0
);
// timestamp of the data is incorrect
if
(
pSDataBlock
->
info
.
window
.
skey
<=
0
||
pSDataBlock
->
info
.
window
.
ekey
<=
0
)
{
qError
(
"table uid %"
PRIu64
" data block timestamp is out of range! minKey %"
PRId64
",maxKey %"
PRId64
,
pSDataBlock
->
info
.
id
.
uid
,
pSDataBlock
->
info
.
window
.
skey
,
pSDataBlock
->
info
.
window
.
ekey
);
}
}
if
(
IS_FINAL_OP
(
pInfo
))
{
startPos
=
getNextQualifiedFinalWindow
(
&
pInfo
->
interval
,
&
nextWin
,
&
pSDataBlock
->
info
,
tsCols
,
prevEndPos
);
}
else
{
...
...
tests/script/tsim/stream/basic1.sim
浏览文件 @
12cea405
...
...
@@ -834,4 +834,57 @@ endi
print ====== test _wstart end
print insert into ts1 values(-1648791211000,1,2,3)
sql create database test7 vgroups 1;
sql use test7;
sql create stable st(ts timestamp, a int, b int , c int) tags(ta int,tb int,tc int);
sql create table ts1 using st tags(1,1,1);
sql create stream streams7 trigger at_once into streamt7 as select _wstart, count(*) from ts1 interval(10s) ;
sql insert into ts1 values(1648791211000,1,2,3);
sql_error insert into ts1 values(-1648791211000,1,2,3);
loop18:
sleep 200
sql select * from streamt7;
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
if $rows != 1 then
print =====rows=$rows
goto loop18
endi
if $data01 != 1 then
print =====data01=$data01
goto loop18
endi
sql_error insert into ts1 values(-1648791211001,1,2,3) (1648791211001,1,2,3);
sql select _wstart, count(*) from ts1 interval(10s) ;
print $data00 $data01
print $data10 $data11
loop19:
sleep 200
sql select * from streamt7;
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
if $rows != 1 then
print =====rows=$rows
goto loop19
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
tests/script/tsim/stream/triggerInterval0.sim
浏览文件 @
12cea405
...
...
@@ -29,69 +29,119 @@ sql insert into t1 values(1648791223001,2,2,3,1.1);
sql insert into t1 values(1648791223002,2,2,3,1.1);
sql insert into t1 values(1648791223003,2,2,3,1.1);
sql insert into t1 values(1648791223001,2,2,3,1.1);
print step 0
$loop_count = 0
loop0:
sleep 300
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sql select * from streamt;
if $rows != 1 then
print ======$rows
return -1
goto loop0
endi
if $data01 != 1 then
print ======$data01
return -1
goto loop0
endi
sql insert into t1 values(1648791233001,2,2,3,1.1);
print step 1
$loop_count = 0
loop1:
sleep 300
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sql select * from streamt;
if $rows != 2 then
print ======$rows
return -
1
goto loop
1
endi
if $data01 != 1 then
print ======$data01
return -
1
goto loop
1
endi
if $data11 != 3 then
print ======$data11
return -
1
goto loop
1
endi
sql insert into t1 values(1648791223004,2,2,3,1.1);
sql insert into t1 values(1648791223004,2,2,3,1.1);
sql insert into t1 values(1648791223005,2,2,3,1.1);
print step 2
$loop_count = 0
loop2:
sleep 300
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sql select * from streamt;
if $rows != 2 then
print ======$rows
return -1
goto loop2
endi
if $data01 != 1 then
print ======$data01
return -1
goto loop2
endi
if $data11 != 5 then
print ======$data11
return -1
goto loop2
endi
sql insert into t1 values(1648791233002,3,2,3,2.1);
sql insert into t1 values(1648791213002,4,2,3,3.1)
sql insert into t1 values(1648791213002,4,2,3,4.1);
print step 3
$loop_count = 0
loop3:
sleep 300
$loop_count = $loop_count + 1
if $loop_count == 10 then
return -1
endi
sql select * from streamt;
if $rows != 2 then
print ======$rows
return -1
goto loop3
endi
if $data01 != 2 then
print ======$data01
return -1
goto loop3
endi
if $data11 != 5 then
print ======$data11
return -1
goto loop3
endi
system sh/exec.sh -n dnode1 -s stop -x SIGINT
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录