1

我需要有点像这样。

//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

但有些第三事件无法自动触发派生事件重新计算。
第 4 个事件的到来触发并根据需要提供输出。
有什么标准的做法吗?

我想计算新事件是进入窗口还是离开窗口的总和。

4

1 回答 1

1

3. 事件(删除)确实会通过“插入派生事件”触发新总和的输出,除非没有删除任何内容,因此您的 id 键可能是错误的。如果仍有问题,请向 esper 用户邮件列表发送一个最小的测试用例。或者使用@Audit 查看引擎在内部对每个语句做了什么。

于 2012-11-28T11:56:25.563 回答