Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

使用状态窗口创建流式计算统计的结果值与单纯状态窗口查询统计结果不一致 #27243

Open
wuyoude12 opened this issue Aug 15, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@wuyoude12
Copy link

1. 创建超级表语句
CREATE STABLE skywalk_smm.truck (ts timestamp, lng double, lat double, berth_id varchar(20), speed double) TAGS (device_no varchar(20), terminal_id varchar(20), type int);
2. 创建流式计算
create stream if not exists berthsteam7 trigger at_once watermark 180s ignore update 0 fill_history 1 into skywalk_smm.berthsteam7 as select _wstart as start_time, _wend as end_time ,berth_id,timediff(_wstart,_wend ,1s) as diff,device_no from skywalk_smm.truck partition by tbname state_window(berth_id);
3. 状态窗口查询
select _wstart as start_time, _wend as end_time ,berth_id,timediff(_wstart,_wend ,1s) as diff,device_no from skywalk_smm.truck partition by tbname state_window(berth_id);

**问题:**通过流式计算进行统计数据,后台数据跑了一天后,查询某台设备的数据,窗口关闭,并且多了一条不应该存在的窗口数据,正常情况下应该是在同一个窗口里面
现象:
流式计算查询设备sql
SELECT * FROM SKYWALK_SMM.berthsteam7 where device_no =710;
lQLPJwKkgw0h5l_NATPNBZCw7KohAblZUXAGptbTlERYAA_1424_307
状态窗口查询sql
select * from (select _wstart as start_time, _wend as end_time, berth_id, timediff(_wstart, _wend , 1s) as diff, device_no from skywalk_smm.truck partition by tbname state_window(berth_id) ) t where t.device_no =710;
lQLPJwNmO_ql_R_M880DpLBHCowaJqotHAam1_lMABgA_932_243
预期结果值
使用流式计算结果应该与状态窗口查询统计的结果一致

@wuyoude12 wuyoude12 added the bug Something isn't working label Aug 15, 2024
@yu285
Copy link
Contributor

yu285 commented Aug 19, 2024

请问版本号是?

@wuyoude12
Copy link
Author

请问版本号是?

3.3.2.0 Community

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants