Esper \ Time functions in the query
I am new in using the esper engine (java) - and I didn't find an answer in their documentation to the following question:
My event object has Date member. what date functions开发者_开发问答 are available in this EPL query language to compare dates (before, after) to calculate the interval between two dates ([ where d1 - d2 > 4 days] etc. )
In short, where are all the date functions to this query langugage?
Esper currently doesn't itself offer EPL constructs specifically to handle Date/Calendar functions. Its easy however to plug in you own single-row function or static methods to handle. Version 4.2 is planned to have extensive datetime methods.
The latest version (8.8.0 as of writing this answer) has extensive date / time functions
http://esper.espertech.com/release-8.8.0/reference-esper/html/datetimereference.html
A similar example of after
from that page
select * from A#lastevent as a, B#lastevent as b where a.after(b, 5 sec)
// Above matches when:
// a.startTimestamp - b.endTimestamp >= 5 seconds
精彩评论