I'm new to Esper and I'm trying to get the results of multiple EPStatements to run through the same UpdateListener. For instance:
EPServiceProvider epService = EPServiceProviderManager.getDefaultProvider();
EPStatement avgStatement = epService.getEPAdministrator()
.createEPL("select avg(price) from OrderEvent.win:time(30 sec)");
EPStatement sumStatement = epService.getEPAdministrator()
.createEPL("select sum(price) from OrderEvent.win:time(60 sec)");
Is it possible to combine the results of both of those EPStatements into a separate statement? Something like:
EPStatement bothStatements = epService.getEPAdministrator()
.createEPL("select * from avg(price), sum(price) where a.id=b.id");
bothStatements.addListener(listener);
I tried using inserting both statements into an Esper Named Window, but it seems like I can't do something like this where:
- Event = (id, itemName, price)
- Statement1 = (id, avg)
- Statement2 = (id, sum)
- Named Window = (id, avg, sum)
I would like to be able to combine the results of multiple statements and get a set of results (per event) into a single output stream.
Thanks for helping.