Let's say that I have a simple object:
public class StockTick{
private String symbol;
private decimal price;
private Date date;
private int unixTimestamp
}
How should I modify following query to use StockTick.date or StockTick.unixTimestamp to agregate within .win:time() window?
select avg(price) from StockTick.win:time(30 sec) where symbol='IBM'
If events are already ordered by unix timestamp, you don't need to modify the query. Just do this for each event:
runtime.sendEvent(new CurrentTimeEvent(unixTimestamp));
runtime.sendEvent(stockTickEvent);
This above code uses the external time so disable the default internal system time. For completely unordered or unstaged events, don't use a time window at all and instead think about how a group-by would look like.