1
我需要这样。Esper窗口的使用:基于事件离开窗口的重新计算
//Create a named window (w1)
Create window w1....
//then insert events into window
insert into w1....
select amount,.....
from....
where...
//remove from window
on RemoveEventArrived as r
Delete from w1
where w1.id = r.id
现在插入到另一个事件从W1命名的窗口
//inserting into final output event
insert into derivedevent
select sum(w.amount)
from w1 as w
suppose event sequence:
1. Event with id=1 and amount= 100 arrived.
o/p of sum(amount) triggered and gives 100.
2. Event withid = 2 and amount=200 arrived.
o/p of sum(amount) triggered and gives 300.
3. **Remove** Event with id=1 arrived.
o/p of sum(amount) triggered and gives 200.
4. Event with id = 3 and amount=500 arrived
o/p of sum(amount) triggered and gives 700
,但有些事件3不能自动触发derivedevent recalculatin。
第4个事件到达时触发并根据需要输出。
任何标准的做法?
我想计算一个新事件是否进入窗口或离开它的总量。
我已更新问题请仔细查看。特别是第四项活动根据需要提供o/p。 –