0

一般来说,Esper 和 EPL 的新手,我有两个基本相反的用例。首先,我需要在时间窗口中捕获所有独特事件,使用firstunique(*parameters*).win:time(*time*).

现在我需要做的是完全相反的,基本上捕获所有到达该窗口并且未被该语句抛出的事件,基本上是所有重复项。

我怎样才能做到这一点?谢谢 !

4

2 回答 2

0

我实际上找到了一个解决方案,它涉及在比较参数的基础上对传入事件使用唯一 id。

查询看起来像这样:

select * from Event a where exists (select * from Event.std:firstUnique(*parameters*).win:time(*time*) b where a.eventId <> b.eventId)

这解决了我遇到的问题,exists方法将返回每个事件(重复事件和唯一事件),因为子查询中的窗口将首先被填充。

于 2017-07-11T08:34:30.427 回答
0

您可以使用子查询并且“不存在”。例如:

select * from Event e1 where not exists (select * from Event#firstunique(*parameters*)#time(*time*) e2 where e1.parameters = e2.parameters)
于 2017-07-06T15:56:16.667 回答