Search code examples
esper

Sometimes do not work when use Esper inner join


EPL is like this:

select cast(a.ReportTime,date,dateformat:'yyyy-MM-dd') as ReportTime, a.Source, aa.RequestNum, a.ServerTotal, a.ServerSucc, b.Total, b.Succ, NULL as DataChange_LastTime, c.Response from IntlTotalCountEvent.win:time_batch(2 min) as aa inner join A.win:time_batch(2 min) as a on aa.ReportTime=a.ReportTime and aa.Source=a.Source inner join B.win:time_batch(2 min) as b on a.ReportTime=b.ReportTime and a.Source=b.Source inner join C.win:time_batch(1 min 30 sec) as c on a.ReportTime=c.ReportTime and a.Source=c.Source Sometimes it works,but sometimes doesn't work,even Fields ReportTime and Source both use same datas.


Solution

  • Batch windows start when an event arrives. Each batch window is therefore independent and un-aligned with respect to other batch windows. If you want to align the batch windows use a context "create context Every5Sec start @now end after 2 minutes" and "win:keepall" instead of "win:batch".