1

I'm try to solve simple task: 1. I want to correlate occurrence of 3 events A, B, C in case they happen in last 10 seconds.

Thus Siddhi supports only 2 join in query, I think that I'm not able to solve it. In documentation there's suggestion to use multiple queries and join them together like this

from A#window.time(10 sec) as a
join B#window.time(10 sec) as b on a.id == b.id
select a.id
insert into tempA

from tempA#window.time(10 sec) as a
join C#window.time(10 sec) as c on c.id == a.id
select *
insert into finalResult

But this produces wrong results, because data in stream tempA can live longer, time windows are not aligned.

Maybe I'm something missing. Any advice? Thanks

Community
  • 1
  • 1
e.tichy
  • 11
  • 1

1 Answers1

0

To solve this, you can try the following approach:

  1. For each incoming event, add a timestamp. (You can also do this in your client itself as well instead of doing it in cep.)
  2. Replace the time windows with external time windows
  3. Use the previously added timestamp field as the reference of time for external time windows

Since the timestamps will be global in this case and all the external time windows will be operating according to them, this should work properly.

Rajeev Sampath
  • 2,739
  • 1
  • 16
  • 19