如何批处ESPER EPL事件

时间:2017-10-04 12:23:01

标签: esper

我正在尝试批处理此类通知事件,并且我收到一个带有单个通知事件的通知事件。任何人都可以帮助我吗?

事先提前。

相关陈述

INSERT INTO Notification SELECT d.id as id,a.stationId as stationId,d.firebaseToken as firebaseToken, d.position as devicePos,a.location as stationPos,a.levelNumber as levelNumber,a.levelName as levelName FROM AirQualityAlert.win:time(3sec) as a, device.win:time(3sec) as d WHERE d.position.distance(a.location) < 300

INSERT INTO Notifications SELECT * FROM Notification.std:groupwin(id).win:time_batch(20sec) for grouped_delivery(id)

1 个答案:

答案 0 :(得分:1)

此解决方案每个ID提供一行&#39;包含带有事件列表的列。

create context Batch20Sec start @now end after 20 sec;
context Batch20Sec select id, window(*) as data 
from Notifications#keepall 
group by id 
output all when terminated;

我认为这就是你想要的。