3

How do I achieve the same effect of Spark Streaming sliding window, which runs at X sliding interval over the last Y window length.

Looking at Esper, it should be win:time and win:time_batch, where win:time >= win:time_batch.

Nora Olsen
  • 983
  • 2
  • 10
  • 22

2 Answers2

1

In esper the equivalent is to declare a context.

create context BucketOf10Sec start @now end after 10 seconds;

context BucketOf10Sec select sum(price) from MyEvent;
Dakotah North
  • 1,324
  • 12
  • 29
user3613754
  • 816
  • 1
  • 5
  • 5
1

I managed to solve this problem in less customizable but easier way (at least for me), by using win:time with OUTPUT EVERY x

SELECT value
FROM Entry.win:time(10 sec)
OUTPUT EVERY 5 sec

Works as I intended - every 5 seconds I get results from the last 10 seconds.

konkit
  • 349
  • 5
  • 11