<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<id>tag:old.nabble.com,2006:forum-24501</id>
	<title>Nabble - Esper User list</title>
	<updated>2009-12-10T05:53:25Z</updated>
	<link rel="self" type="application/atom+xml" href="http://old.nabble.com/Esper-User-list-f24501.xml" />
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Esper-User-list-f24501.html" />
	<subtitle type="html"></subtitle>
	
<entry>
	<id>tag:old.nabble.com,2006:post-26727578</id>
	<title>Re: Retrieving events prior an event</title>
	<published>2009-12-10T05:53:25Z</published>
	<updated>2009-12-10T05:53:25Z</updated>
	<author>
		<name>Cédric Moonen</name>
	</author>
	<content type="html">&lt;html&gt;
&lt;body&gt;
Hello Thomas,&lt;br&gt;&lt;br&gt;
Thanks for the reply, but I still can't reach a good solution for this...
&lt;br&gt;&lt;br&gt;
If I use the match_recognize, I end up with something like this:&lt;br&gt;
&lt;i&gt;select * from BaseEvent&lt;br&gt;
match_recognize(&lt;br&gt;
&amp;nbsp; measures A as start, B as stop&lt;br&gt;
&amp;nbsp; pattern(A B)&lt;br&gt;
&amp;nbsp; define&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; B as instanceof(B, DerivedEvent)&lt;br&gt;
)&lt;br&gt;&lt;br&gt;
&lt;/i&gt;This gives an error (Incorrect syntax near 'B'). Furthermore, I still
can't access the fields specific to DerivedEvent (or I have to use the
cast function and I will end up with something extremely
complicated).&lt;br&gt;&lt;br&gt;
I tried also using the prev function and it could almost do what I'm
looking for, except that the prev function selects only a field, and not
the complette event. Is it possible to have something like this:&lt;br&gt;
&lt;i&gt;select prev(5, BaseEvent) from DerivedEvent(....) unidirectional,
BaseEvent.win:length(5)&lt;br&gt;&lt;br&gt;
&lt;/i&gt;So, in the prev function I select the full BaseEvent (of course, this
gives an error stating that BaseEvent is not valid in any streams).
&lt;br&gt;&lt;br&gt;
I really would like to find an elegant solution to this problem but it
seems there's none :(. The problem seemed to be very simple but trying to
express that in Esper is much more complicated than I first
thought.&lt;br&gt;&lt;br&gt;
Thanks for any additional feedback.&lt;br&gt;
Cédric&lt;br&gt;&lt;br&gt;
At 14:14 10/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=cite class=cite cite=&quot;&quot;&gt;Hi Cedric,&lt;br&gt;&lt;br&gt;
match recognize can also work with variant streams, i.e. multiple types
of events. Yes followed-by in a pattern is another way, and a
where-clause against &amp;quot;prev&amp;quot; is also possible for example with
length window.&lt;br&gt;&lt;br&gt;
Best regards&lt;br&gt;
Tom&lt;br&gt;
&lt;br&gt;
&lt;font face=&quot;Tahoma&quot; size=2&gt;&lt;b&gt;From:&lt;/b&gt; Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727578&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&lt;b&gt;To:&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727578&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Sent:&lt;/b&gt; Wed, December 9, 2009 5:02:00 AM&lt;br&gt;
&lt;b&gt;Subject:&lt;/b&gt; Re: [esper-user] Retrieving events prior an event&lt;br&gt;
&lt;/font&gt;&lt;br&gt;
Hello Thomas,&lt;br&gt;&lt;br&gt;
I've looked at the documentation of Esper 3.2 and this is a new feature
(we were still using 3.1). It looks indeed very promising to use the
match-recognize. I will have to experiment with it but I think what might
be a problem (not sure for now) is that you can only work with one type
of events. Luckily, all our events have the same common base class so
there is probably a work around here if we are able to specify a more
defined type in the define clause. Is that possible ?&lt;br&gt;
By the way, I realized that I made a small mistake in my previous
example: what should be retrieved is &amp;quot;A3 B1&amp;quot; and &amp;quot;A12
B2&amp;quot; (and not &amp;quot;A12 B1&amp;quot;), sorry for the confusion.&lt;br&gt;&lt;br&gt;
Out of curiosity, is there a way to achieve this without using the
match-recognize ? Any way using the prev or prior function ?&lt;br&gt;&lt;br&gt;
There is a way but it is really ugly and I really would like to find an
easier solution. Here is what we have right now:&lt;br&gt;
select * from B as evtB unidirectional, pattern[every A[5] as
evtA]&lt;br&gt;&lt;br&gt;
This seems to work fine but it is really complex. Any other better
looking way :-) ?&lt;br&gt;&lt;br&gt;
Thanks&lt;br&gt;
Cédric&lt;br&gt;&lt;br&gt;
&lt;br&gt;
At 19:24 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=cite class=cite cite=&quot;&quot;&gt;Hi Cedrik,&lt;br&gt;&lt;br&gt;
here is a possible match-recognize (the regular expression only):&lt;br&gt;
- A3 B1:&amp;nbsp; (A X X X X B), select A and B&lt;br&gt;
- A12 B1:&amp;nbsp; (B X X X X A), select A and B&amp;nbsp; &lt;br&gt;&lt;br&gt;
or both at the same time &amp;quot;(A X X X X B) | (B X X X X
A)&amp;quot;&lt;br&gt;&lt;br&gt;
Best regards&lt;br&gt;
Tom&lt;br&gt;&lt;br&gt;
&lt;font face=&quot;Tahoma&quot; size=2&gt;&lt;b&gt;From:&lt;/b&gt; Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727578&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&lt;b&gt;To:&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727578&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Sent:&lt;/b&gt; Tue, December 8, 2009 9:07:18 AM&lt;br&gt;
&lt;b&gt;Subject:&lt;/b&gt; Re: [esper-user] Retrieving events prior an event&lt;br&gt;
&lt;/font&gt;&lt;br&gt;
Thanks for the reply,&lt;br&gt;&lt;br&gt;
But I don't think this will really solve my problem. Let me show you with
an example, which will probably be clearer than my explanation. Suppose
the following sequence of events:&lt;br&gt;
A1 A2 A3 A4 A5 A6 A7 B1 A8 A9 A10 A11 A12 A13 A14 A15 A16 B2 A17
A18&lt;br&gt;&lt;br&gt;
What I want to retrieve is:&lt;br&gt;
- A3 B1 (A3 being the fifth A event before B10)&lt;br&gt;
- A12 B1&lt;br&gt;&lt;br&gt;
I don't think this is really feasible using a pattern, is it ?&amp;nbsp;
&lt;br&gt;&lt;br&gt;
At 14:51 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=cite class=cite cite=&quot;&quot;&gt;May be a pattern using repeat or
repeat until would be a better way?&lt;br&gt;&lt;br&gt;
2009/12/8 Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727578&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt; &amp;gt; 
&lt;dl&gt;
&lt;dd&gt;Hello,
&lt;dd&gt;I'm a bit stuck with a problem when trying to retrieve events that
happened before a specific event. My scenario is that I have events
coming in and all those events have the same base event (let's call it
BaseEvent). Then, there are some specific events that I am looking for
(SpecificEvent). I need to retrieve all those specific events with the
base event that occured 5th-prior that specific event.
&lt;dd&gt;The first thing I did was something like this: 
&lt;dd&gt;select * from SpecificEvent as event unidirectional,
BaseEvent.win:length(5).std:firstevent() as prevEvent
&lt;dd&gt;But this didn't work as I expected and looking at the documentation
of the std:firstevent, it is explained there that I should use the prev
function instead because the window is restarted each time. So, I tried
then to use the prev function but there's no explanation in the doc on
how I have to specify that I want the full event and not one of the
properties (although, it is stated that it should be possible). I tried
to write something like this:
&lt;dd&gt;select event, prev(5, *) as prevEvent from SpecificEvent as event
unidirectional, BaseEvent.win:length(5)
&lt;dd&gt;But it complains about the syntax error for the '*' symbol.
&lt;dd&gt;So my questions are: 
&lt;dd&gt;1) How to write suche a statement ? 
&lt;dd&gt;2) If there are multiple streams, how will the prev function
&amp;quot;know&amp;quot; for which stream it has to select the event ?
&lt;dd&gt;I'm a bit confused with this prev function.
&lt;dd&gt;Thanks for your feedback. 
&lt;dd&gt;Cédric&lt;br&gt;

&lt;dd&gt;--------------------------------------------------------------------- 
&lt;dd&gt;To unsubscribe from this list, please visit:
&lt;dd&gt;&amp;nbsp;
&lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;
http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;/blockquote&gt;
&lt;/dl&gt;Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727578&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.fmtc.be/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;www.fmtc.be&lt;/a&gt;&lt;/blockquote&gt;&lt;br&gt;
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727578&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.fmtc.be/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;www.fmtc.be&lt;br&gt;
&lt;/a&gt;&lt;/blockquote&gt;
&lt;x-sigsep&gt;&lt;p&gt;&lt;/x-sigsep&gt;
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&lt;x-tab&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727578&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&lt;x-tab&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.fmtc.be/&quot; eudora=&quot;autourl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;www.fmtc.be&lt;br&gt;
&lt;/a&gt;&lt;/body&gt;
&lt;/html&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Retrieving-events-prior-an-event-tp26691705p26727578.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26727123</id>
	<title>Re: Retrieving events prior an event</title>
	<published>2009-12-10T05:14:57Z</published>
	<updated>2009-12-10T05:14:57Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;Hi Cedric,&lt;br&gt;&lt;br&gt;match recognize can also work with variant streams, i.e. multiple types of events. Yes followed-by in a pattern is another way, and a where-clause against &quot;prev&quot; is also possible for example with length window.&lt;br&gt;&lt;br&gt;Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: times new roman,new york,times,serif; font-size: 12pt;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; Cédric Moonen &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727123&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727123&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Wed, December 9, 2009 5:02:00 AM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] Retrieving events prior
 an event&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;off&quot;&gt;

Hello Thomas,&lt;br&gt;&lt;br&gt;
I've looked at the documentation of Esper 3.2 and this is a new feature
(we were still using 3.1). It looks indeed very promising to use the
match-recognize. I will have to experiment with it but I think what might
be a problem (not sure for now) is that you can only work with one type
of events. Luckily, all our events have the same common base class so
there is probably a work around here if we are able to specify a more
defined type in the define clause. Is that possible ?&lt;br&gt;
By the way, I realized that I made a small mistake in my previous
example: what should be retrieved is &quot;A3 B1&quot; and &quot;A12
B2&quot; (and not &quot;A12 B1&quot;), sorry for the confusion.&lt;br&gt;&lt;br&gt;
Out of curiosity, is there a way to achieve this without using the
match-recognize ? Any way using the prev or prior function ?&lt;br&gt;&lt;br&gt;
There is a way but it is really ugly and I really would like to find an
easier solution. Here is what we have right now:&lt;br&gt;
select * from B as evtB unidirectional, pattern[every A[5] as
evtA]&lt;br&gt;&lt;br&gt;
This seems to work fine but it is really complex. Any other better
looking way :-) ?&lt;br&gt;&lt;br&gt;
Thanks&lt;br&gt;
Cédric&lt;br&gt;&lt;br&gt;
&lt;br&gt;
At 19:24 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=&quot;cite&quot; class=&quot;cite&quot; cite=&quot;&quot;&gt;Hi Cedrik,&lt;br&gt;&lt;br&gt;
here is a possible match-recognize (the regular expression only):&lt;br&gt;
- A3 B1:&amp;nbsp; (A X X X X B), select A and B&lt;br&gt;
- A12 B1:&amp;nbsp; (B X X X X A), select A and B&amp;nbsp; &lt;br&gt;&lt;br&gt;
or both at the same time &quot;(A X X X X B) | (B X X X X
A)&quot;&lt;br&gt;&lt;br&gt;
Best regards&lt;br&gt;
Tom&lt;br&gt;
&lt;br&gt;
&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;b&gt;From:&lt;/b&gt; Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727123&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&lt;b&gt;To:&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727123&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Sent:&lt;/b&gt; Tue, December 8, 2009 9:07:18 AM&lt;br&gt;
&lt;b&gt;Subject:&lt;/b&gt; Re: [esper-user] Retrieving events prior an event&lt;br&gt;
&lt;/font&gt;&lt;br&gt;
Thanks for the reply,&lt;br&gt;&lt;br&gt;
But I don't think this will really solve my problem. Let me show you with
an example, which will probably be clearer than my explanation. Suppose
the following sequence of events:&lt;br&gt;
A1 A2 A3 A4 A5 A6 A7 B1 A8 A9 A10 A11 A12 A13 A14 A15 A16 B2 A17
A18&lt;br&gt;&lt;br&gt;
What I want to retrieve is:&lt;br&gt;
- A3 B1 (A3 being the fifth A event before B10)&lt;br&gt;
- A12 B1&lt;br&gt;&lt;br&gt;
I don't think this is really feasible using a pattern, is it ?&amp;nbsp;
&lt;br&gt;&lt;br&gt;
At 14:51 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=&quot;cite&quot; class=&quot;cite&quot; cite=&quot;&quot;&gt;May be a pattern using repeat or
repeat until would be a better way?&lt;br&gt;&lt;br&gt;
2009/12/8 Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727123&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;
&amp;gt;
&lt;dl&gt;
&lt;dd&gt;Hello,&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;I'm a bit stuck with a problem when trying to retrieve events that
happened before a specific event. My scenario is that I have events
coming in and all those events have the same base event (let's call it
BaseEvent). Then, there are some specific events that I am looking for
(SpecificEvent). I need to retrieve all those specific events with the
base event that occured 5th-prior that specific event.&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;The first thing I did was something like this:
&lt;/dd&gt;&lt;dd&gt;select * from SpecificEvent as event unidirectional,
BaseEvent.win:length(5).std:firstevent() as prevEvent&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;But this didn't work as I expected and looking at the documentation
of the std:firstevent, it is explained there that I should use the prev
function instead because the window is restarted each time. So, I tried
then to use the prev function but there's no explanation in the doc on
how I have to specify that I want the full event and not one of the
properties (although, it is stated that it should be possible). I tried
to write something like this:&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;select event, prev(5, *) as prevEvent from SpecificEvent as event
unidirectional, BaseEvent.win:length(5)&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;But it complains about the syntax error for the '*' symbol.&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;So my questions are:
&lt;/dd&gt;&lt;dd&gt;1) How to write suche a statement ?
&lt;/dd&gt;&lt;dd&gt;2) If there are multiple streams, how will the prev function
&quot;know&quot; for which stream it has to select the event ?&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;I'm a bit confused with this prev function.&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;Thanks for your feedback.
&lt;/dd&gt;&lt;dd&gt;Cédric&lt;br&gt;
&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;
---------------------------------------------------------------------
&lt;/dd&gt;&lt;dd&gt;To unsubscribe from this list, please visit:&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;&lt;span&gt;&amp;nbsp;
&lt;a target=&quot;_blank&quot; href=&quot;http://xircles.codehaus.org/manage_email&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;/span&gt;&lt;br&gt;
&lt;br&gt;
&lt;/dd&gt;&lt;/dl&gt;&lt;/blockquote&gt;
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727123&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.fmtc.be/&quot;&gt;www.fmtc.be&lt;br&gt;
&lt;/a&gt;&lt;/blockquote&gt;
&lt;p&gt; 
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26727123&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.fmtc.be/&quot;&gt;www.fmtc.be&lt;br&gt;
&lt;/a&gt;&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;on&quot;&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg1.c1.mail.mud.yahoo.com compressed/chunked Tue Dec  8 20:25:37 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Retrieving-events-prior-an-event-tp26691705p26727123.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26721587</id>
	<title>Re: Stuck at NStreamQueryPlanBuilder.computeBestPath</title>
	<published>2009-12-09T19:22:18Z</published>
	<updated>2009-12-09T19:22:18Z</updated>
	<author>
		<name>pedroteixeira</name>
	</author>
	<content type="html">&lt;br&gt;got it. &amp;nbsp;thanks a lot!
&lt;br&gt;&lt;br&gt;yep, I just needs to keep a single value from the last event from many streams and convert them (kind of transposing) to a single event. The mechanism should be efficient even with ~ 500 events. The use case for this is that I want Esper to create a kind of vector snapshot from several streams.
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Thomas Bernhardt wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;If your 15 subqueries are very similar, perhaps a single subquery and a custom plugin aggregation function would be another way to go, function to simply return all x events in an array
&lt;br&gt;&lt;br&gt;For example: &amp;nbsp;
&lt;br&gt;&lt;br&gt;select 
&lt;br&gt;&amp;nbsp; (select myaggregation(value) from Event.std:unique(value)), &amp;nbsp;j.value
&lt;br&gt;from Event(id=14).std.lastevent() as j
&lt;br&gt;&lt;br&gt;Best regards
&lt;br&gt;Tom
&lt;br&gt;&lt;br&gt;&lt;br&gt;________________________________
&lt;br&gt;From: pedroteixeira &amp;lt;pedro.t@gmail.com&amp;gt;
&lt;br&gt;To: user@esper.codehaus.org
&lt;br&gt;Sent: Wed, December 9, 2009 2:04:42 PM
&lt;br&gt;Subject: Re: [esper-user] Stuck at NStreamQueryPlanBuilder.computeBestPath
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks, Thomas. Will create a test case and then create the issue.
&lt;br&gt;&lt;br&gt;I'was reading the example in the docs:
&lt;br&gt;// Fast version, second alternative
&lt;br&gt;select 
&lt;br&gt;&amp;nbsp; (select avg(value) from MyEvent.win:length(100)) as avgA, 
&lt;br&gt;&amp;nbsp; (select avg(value) from MyEvent.win:length(50)) as avgB,
&lt;br&gt;&amp;nbsp; a.symbol
&lt;br&gt;from MyEvent.std:lastevent() a, MyEvent.std:lastevent() b
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;For a 15-stream join, is this the subquery approach that you meant?
&lt;br&gt;&lt;br&gt;select 
&lt;br&gt;&amp;nbsp; (select value from Event(id=1).std:lastevent()),
&lt;br&gt;&amp;nbsp; (select value from Event(id=2).std:lastevent()),
&lt;br&gt;...
&lt;br&gt;&amp;nbsp; (select value from Event(id=13).std:lastevent()),
&lt;br&gt;&amp;nbsp; j.value
&lt;br&gt;from Event(id=14).std.lastevent() as j
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Pedro
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Thomas Bernhardt wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Hi,
&lt;br&gt;&amp;gt; can you please create a JIRA and attach the test Java class.
&lt;br&gt;&amp;gt; As a workaround to a 15-stream join consider subqueries.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Best regards
&lt;br&gt;&amp;gt; Tom
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ________________________________
&lt;br&gt;&amp;gt; From: pedroteixeira &amp;lt;pedro.t@gmail.com&amp;gt;
&lt;br&gt;&amp;gt; To: user@esper.codehaus.org
&lt;br&gt;&amp;gt; Sent: Wed, December 9, 2009 8:10:18 AM
&lt;br&gt;&amp;gt; Subject: Re: [esper-user] Stuck at NStreamQueryPlanBuilder.computeBestPath
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; TYPO. The actual query is more like this:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; select a.value, b.value, c.value ... j.value from Stream(id =
&lt;br&gt;&amp;gt; 1).std:lastevent() as a, Stream(id = 2).std:lastevent() as b, ...,
&lt;br&gt;&amp;gt; Stream(id
&lt;br&gt;&amp;gt; =10).std:lastevent() as j
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; pedroteixeira wrote:
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; I've stumbled across a problem, but need some help to understand what it
&lt;br&gt;&amp;gt;&amp;gt; is the intended behavior of the NStreamQueryPlanBuilder class. &amp;nbsp;Perhaps,
&lt;br&gt;&amp;gt;&amp;gt; someone has already had this problem, but I was not able to find in the
&lt;br&gt;&amp;gt;&amp;gt; archive.
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; I have a query which joins 10 streams in the following manner:
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; select a.value, b.value, c.value ... j.value from Stream(id = 1) as a,
&lt;br&gt;&amp;gt;&amp;gt; Stream(id = 2) as b, ..., Stream(id =10) as j
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; The esper engine gets stuck in the &amp;quot;computeBestPath&amp;quot; method, consuming
&lt;br&gt;&amp;gt;&amp;gt; one
&lt;br&gt;&amp;gt;&amp;gt; of the CPUs allocated to the running thread. With yourkit, I extracted
&lt;br&gt;&amp;gt;&amp;gt; the
&lt;br&gt;&amp;gt;&amp;gt; following stack trace:
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.collection.PermutationEnumeration.nextElement()
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.collection.NumberSetPermutationEnumeration.nextElement()
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.computeBestPath(int,
&lt;br&gt;&amp;gt;&amp;gt; QueryGraph, HistoricalDependencyGraph)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.build(QueryGraph,
&lt;br&gt;&amp;gt;&amp;gt; EventType[], boolean, boolean[], HistoricalDependencyGraph,
&lt;br&gt;&amp;gt;&amp;gt; HistoricalStreamIndexList[])
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.epl.join.plan.QueryPlanBuilder.getPlan(EventType[],
&lt;br&gt;&amp;gt;&amp;gt; List, QueryGraph, String[], boolean, boolean[],
&lt;br&gt;&amp;gt;&amp;gt; HistoricalDependencyGraph, HistoricalStreamIndexList[],
&lt;br&gt;&amp;gt;&amp;gt; ExprEvaluatorContext)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.epl.join.JoinSetComposerFactoryImpl.makeComposer(List,
&lt;br&gt;&amp;gt;&amp;gt; ExprNode, EventType[], String[], Viewable[],
&lt;br&gt;&amp;gt;&amp;gt; SelectClauseStreamSelectorEnum, StreamJoinAnalysisResult,
&lt;br&gt;&amp;gt;&amp;gt; ExprEvaluatorContext)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.handleJoin(String[],
&lt;br&gt;&amp;gt;&amp;gt; EventType[], Viewable[], ResultSetProcessor,
&lt;br&gt;&amp;gt;&amp;gt; SelectClauseStreamSelectorEnum, StatementContext, List,
&lt;br&gt;&amp;gt;&amp;gt; StreamJoinAnalysisResult)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.startSelect(boolean)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.start(boolean, boolean,
&lt;br&gt;&amp;gt;&amp;gt; boolean)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.startInternal(String,
&lt;br&gt;&amp;gt;&amp;gt; StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.start(String,
&lt;br&gt;&amp;gt;&amp;gt; StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,
&lt;br&gt;&amp;gt;&amp;gt; String, boolean, String, String, Map, Object, EPIsolationUnitServices)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,
&lt;br&gt;&amp;gt;&amp;gt; String, boolean, String, Object, EPIsolationUnitServices)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel,
&lt;br&gt;&amp;gt;&amp;gt; String)
&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel)
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; There seems to be some sort of caveat in the &amp;quot;computeBestPath&amp;quot; method,
&lt;br&gt;&amp;gt;&amp;gt; since it might have to try 15! combinations (in my case). Is that really
&lt;br&gt;&amp;gt;&amp;gt; intented?
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Thanks a bunch,
&lt;br&gt;&amp;gt;&amp;gt; Pedro
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; -- 
&lt;br&gt;&amp;gt; View this message in context:
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26709902.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26709902.html&lt;/a&gt;&lt;br&gt;&amp;gt; Sent from the Esper User list mailing list archive at Nabble.com.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; ---------------------------------------------------------------------
&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp;&lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp;
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;View this message in context: &lt;a href=&quot;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26715790.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26715790.html&lt;/a&gt;&lt;br&gt;Sent from the Esper User list mailing list archive at Nabble.com.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26721587.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26721421</id>
	<title>Re: Retrieving events prior an event</title>
	<published>2009-12-09T18:58:56Z</published>
	<updated>2009-12-09T18:58:56Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;use &quot;instanceof&quot;?&lt;br&gt;&lt;br&gt;Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: times new roman,new york,times,serif; font-size: 12pt;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; Cédric Moonen &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721421&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721421&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Wed, December 9, 2009 6:12:41 AM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] Retrieving events prior an event&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;off&quot;&gt;

I made a mistake in my previous reply. The statement that is working
looks like this in fact:&lt;br&gt;
select * from B as evtB unidirectional, pattern[every evtA=A -&amp;gt; A
-&amp;gt; A -&amp;gt; A -&amp;gt; A]&lt;br&gt;&lt;br&gt;
Which is even more ugly...&lt;br&gt;&lt;br&gt;
I've been looking at the mathc_recognize but as I expected I am a bit
stuck on detecting the type of the event in the define clause. What I
have so far is:&lt;br&gt;&lt;br&gt;
select * from BaseEvent&lt;br&gt;
match_recognize (&lt;br&gt;
&amp;nbsp; measures A as start, B as stop&lt;br&gt;
&amp;nbsp; pattern(A X X X X B)&lt;br&gt;
&amp;nbsp; define &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; B as (??? AND B.var1=&quot;Val1&quot; AND
B.var2=&quot;Val2&quot; ) &lt;br&gt;
)&lt;br&gt;&lt;br&gt;
So, to summarize, both A and B inherit from BaseEvent. The
&quot;???&quot; in the define should be replaced by something that
specifies the type of the event B (event A can be of any type). var1 and
var2 are both members of the more derived type which B is representing.
Is there any way to do this ?&lt;br&gt;&lt;br&gt;
Thanks for any feedback.&lt;br&gt;
Cédric&lt;br&gt;&lt;br&gt;
&lt;br&gt;
At 11:02 9/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=&quot;cite&quot; class=&quot;cite&quot; cite=&quot;&quot;&gt;Hello Thomas,&lt;br&gt;&lt;br&gt;
I've looked at the documentation of Esper 3.2 and this is a new feature
(we were still using 3.1). It looks indeed very promising to use the
match-recognize. I will have to experiment with it but I think what might
be a problem (not sure for now) is that you can only work with one type
of events. Luckily, all our events have the same common base class so
there is probably a work around here if we are able to specify a more
defined type in the define clause. Is that possible ?&lt;br&gt;
By the way, I realized that I made a small mistake in my previous
example: what should be retrieved is &quot;A3 B1&quot; and &quot;A12
B2&quot; (and not &quot;A12 B1&quot;), sorry for the confusion.&lt;br&gt;
&lt;br&gt;
Out of curiosity, is there a way to achieve this without using the
match-recognize ? Any way using the prev or prior function ?&lt;br&gt;&lt;br&gt;
There is a way but it is really ugly and I really would like to find an
easier solution. Here is what we have right now:&lt;br&gt;
select * from B as evtB unidirectional, pattern[every A[5] as
evtA]&lt;br&gt;&lt;br&gt;
This seems to work fine but it is really complex. Any other better
looking way :-) ?&lt;br&gt;&lt;br&gt;
Thanks&lt;br&gt;
Cédric&lt;br&gt;&lt;br&gt;
&lt;br&gt;
At 19:24 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=&quot;cite&quot; class=&quot;cite&quot; cite=&quot;&quot;&gt;Hi Cedrik,&lt;br&gt;&lt;br&gt;
here is a possible match-recognize (the regular expression only):&lt;br&gt;
- A3 B1:&amp;nbsp; (A X X X X B), select A and B&lt;br&gt;
- A12 B1:&amp;nbsp; (B X X X X A), select A and B&amp;nbsp; &lt;br&gt;&lt;br&gt;
or both at the same time &quot;(A X X X X B) | (B X X X X
A)&quot;&lt;br&gt;&lt;br&gt;
Best regards&lt;br&gt;
Tom&lt;br&gt;&lt;br&gt;
&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;b&gt;From:&lt;/b&gt; Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721421&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&lt;b&gt;To:&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721421&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Sent:&lt;/b&gt; Tue, December 8, 2009 9:07:18 AM&lt;br&gt;
&lt;b&gt;Subject:&lt;/b&gt; Re: [esper-user] Retrieving events prior an event&lt;br&gt;
&lt;/font&gt;&lt;br&gt;
Thanks for the reply,&lt;br&gt;&lt;br&gt;
But I don't think this will really solve my problem. Let me show you with
an example, which will probably be clearer than my explanation. Suppose
the following sequence of events:&lt;br&gt;
A1 A2 A3 A4 A5 A6 A7 B1 A8 A9 A10 A11 A12 A13 A14 A15 A16 B2 A17
A18&lt;br&gt;&lt;br&gt;
What I want to retrieve is:&lt;br&gt;
- A3 B1 (A3 being the fifth A event before B10)&lt;br&gt;
- A12 B1&lt;br&gt;&lt;br&gt;
I don't think this is really feasible using a pattern, is it ?&amp;nbsp;
&lt;br&gt;&lt;br&gt;
At 14:51 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=&quot;cite&quot; class=&quot;cite&quot; cite=&quot;&quot;&gt;May be a pattern using repeat or
repeat until would be a better way?&lt;br&gt;&lt;br&gt;
2009/12/8 Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721421&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt; &amp;gt; 
&lt;dl&gt;
&lt;dd&gt;Hello,
&lt;/dd&gt;&lt;dd&gt;I'm a bit stuck with a problem when trying to retrieve events that
happened before a specific event. My scenario is that I have events
coming in and all those events have the same base event (let's call it
BaseEvent). Then, there are some specific events that I am looking for
(SpecificEvent). I need to retrieve all those specific events with the
base event that occured 5th-prior that specific event.
&lt;/dd&gt;&lt;dd&gt;The first thing I did was something like this: 
&lt;/dd&gt;&lt;dd&gt;select * from SpecificEvent as event unidirectional,
BaseEvent.win:length(5).std:firstevent() as prevEvent
&lt;/dd&gt;&lt;dd&gt;But this didn't work as I expected and looking at the documentation
of the std:firstevent, it is explained there that I should use the prev
function instead because the window is restarted each time. So, I tried
then to use the prev function but there's no explanation in the doc on
how I have to specify that I want the full event and not one of the
properties (although, it is stated that it should be possible). I tried
to write something like this:
&lt;/dd&gt;&lt;dd&gt;select event, prev(5, *) as prevEvent from SpecificEvent as event
unidirectional, BaseEvent.win:length(5)
&lt;/dd&gt;&lt;dd&gt;But it complains about the syntax error for the '*' symbol.
&lt;/dd&gt;&lt;dd&gt;So my questions are: 
&lt;/dd&gt;&lt;dd&gt;1) How to write suche a statement ? 
&lt;/dd&gt;&lt;dd&gt;2) If there are multiple streams, how will the prev function
&quot;know&quot; for which stream it has to select the event ?
&lt;/dd&gt;&lt;dd&gt;I'm a bit confused with this prev function.
&lt;/dd&gt;&lt;dd&gt;Thanks for your feedback. 
&lt;/dd&gt;&lt;dd&gt;Cédric&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;--------------------------------------------------------------------- 
&lt;/dd&gt;&lt;dd&gt;To unsubscribe from this list, please visit:
&lt;/dd&gt;&lt;dd&gt;&lt;span&gt;&amp;nbsp;
&lt;a target=&quot;_blank&quot; href=&quot;http://xircles.codehaus.org/manage_email&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;/span&gt;&lt;br&gt;
&lt;/dd&gt;&lt;/dl&gt;&lt;/blockquote&gt;
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721421&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.fmtc.be/&quot;&gt;www.fmtc.be&lt;/a&gt;&lt;/blockquote&gt;&lt;br&gt;
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721421&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.fmtc.be/&quot;&gt;www.fmtc.be&lt;/a&gt;
&lt;/blockquote&gt;
&lt;p&gt; 
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721421&amp;i=7&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.fmtc.be/&quot;&gt;www.fmtc.be&lt;br&gt;
&lt;/a&gt;&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;on&quot;&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg1.c1.mail.mud.yahoo.com compressed/chunked Tue Dec  8 20:25:37 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Retrieving-events-prior-an-event-tp26691705p26721421.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26721410</id>
	<title>Re: Stuck at NStreamQueryPlanBuilder.computeBestPath</title>
	<published>2009-12-09T18:56:20Z</published>
	<updated>2009-12-09T18:56:20Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div&gt;If your 15 subqueries are very similar, perhaps a single subquery and a custom plugin aggregation function would be another way to go, function to simply return all x events in an array&lt;br&gt;&lt;br&gt;For example:&amp;nbsp; &lt;br&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;select &lt;br&gt;&amp;nbsp; (select myaggregation(value) from Event.std:unique(value)),&amp;nbsp; j.value&lt;br&gt;from Event(id=14).std.lastevent() as j&lt;br&gt;&lt;br&gt;Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 13px;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; pedroteixeira &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721410&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;pedro.t@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721410&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Wed, December 9,
 2009 2:04:42 PM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] Stuck at NStreamQueryPlanBuilder.computeBestPath&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;br&gt;Thanks, Thomas. Will create a test case and then create the issue.&lt;br&gt;&lt;br&gt;I'was reading the example in the docs:&lt;br&gt;// Fast version, second alternative&lt;br&gt;select &lt;br&gt;&amp;nbsp; (select avg(value) from MyEvent.win:length(100)) as avgA, &lt;br&gt;&amp;nbsp; (select avg(value) from MyEvent.win:length(50)) as avgB,&lt;br&gt;&amp;nbsp; a.symbol&lt;br&gt;from MyEvent.std:lastevent() a, MyEvent.std:lastevent() b&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;For a 15-stream join, is this the subquery approach that you meant?&lt;br&gt;&lt;br&gt;select &lt;br&gt;&amp;nbsp; (select value from Event(id=1).std:lastevent()),&lt;br&gt;&amp;nbsp; (select value from Event(id=2).std:lastevent()),&lt;br&gt;...&lt;br&gt;&amp;nbsp; (select value from Event(id=13).std:lastevent()),&lt;br&gt;&amp;nbsp; j.value&lt;br&gt;from Event(id=14).std.lastevent() as j&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;cheers,&lt;br&gt;Pedro&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;Thomas Bernhardt wrote:&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Hi,&lt;br&gt;&amp;gt; can you please create a JIRA and attach the test Java class.&lt;br&gt;&amp;gt; As a workaround to a 15-stream join consider subqueries.&lt;br&gt;&amp;gt;
 &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Best regards&lt;br&gt;&amp;gt; Tom&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; ________________________________&lt;br&gt;&amp;gt; From: pedroteixeira &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721410&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;pedro.t@...&lt;/a&gt;&amp;gt;&lt;br&gt;&amp;gt; To: &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26721410&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&amp;gt; Sent: Wed, December 9, 2009 8:10:18 AM&lt;br&gt;&amp;gt; Subject: Re: [esper-user] Stuck at NStreamQueryPlanBuilder.computeBestPath&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; TYPO. The actual query is more like this:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; select a.value, b.value, c.value ... j.value from Stream(id =&lt;br&gt;&amp;gt; 1).std:lastevent() as a, Stream(id = 2).std:lastevent() as b, ...,&lt;br&gt;&amp;gt; Stream(id&lt;br&gt;&amp;gt; =10).std:lastevent() as j&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; pedroteixeira wrote:&lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; Hello,&lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; I've stumbled across a problem, but need some help to understand what
 it&lt;br&gt;&amp;gt;&amp;gt; is the intended behavior of the NStreamQueryPlanBuilder class.&amp;nbsp; Perhaps,&lt;br&gt;&amp;gt;&amp;gt; someone has already had this problem, but I was not able to find in the&lt;br&gt;&amp;gt;&amp;gt; archive.&lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; I have a query which joins 10 streams in the following manner:&lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; select a.value, b.value, c.value ... j.value from Stream(id = 1) as a,&lt;br&gt;&amp;gt;&amp;gt; Stream(id = 2) as b, ..., Stream(id =10) as j&lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; The esper engine gets stuck in the &quot;computeBestPath&quot; method, consuming&lt;br&gt;&amp;gt;&amp;gt; one&lt;br&gt;&amp;gt;&amp;gt; of the CPUs allocated to the running thread. With yourkit, I extracted&lt;br&gt;&amp;gt;&amp;gt; the&lt;br&gt;&amp;gt;&amp;gt; following stack trace:&lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.collection.PermutationEnumeration.nextElement()&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.collection.NumberSetPermutationEnumeration.nextElement()&lt;br&gt;&amp;gt;&amp;gt;
 com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.computeBestPath(int,&lt;br&gt;&amp;gt;&amp;gt; QueryGraph, HistoricalDependencyGraph)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.build(QueryGraph,&lt;br&gt;&amp;gt;&amp;gt; EventType[], boolean, boolean[], HistoricalDependencyGraph,&lt;br&gt;&amp;gt;&amp;gt; HistoricalStreamIndexList[])&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.epl.join.plan.QueryPlanBuilder.getPlan(EventType[],&lt;br&gt;&amp;gt;&amp;gt; List, QueryGraph, String[], boolean, boolean[],&lt;br&gt;&amp;gt;&amp;gt; HistoricalDependencyGraph, HistoricalStreamIndexList[],&lt;br&gt;&amp;gt;&amp;gt; ExprEvaluatorContext)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.epl.join.JoinSetComposerFactoryImpl.makeComposer(List,&lt;br&gt;&amp;gt;&amp;gt; ExprNode, EventType[], String[], Viewable[],&lt;br&gt;&amp;gt;&amp;gt; SelectClauseStreamSelectorEnum, StreamJoinAnalysisResult,&lt;br&gt;&amp;gt;&amp;gt; ExprEvaluatorContext)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.handleJoin(String[],&lt;br&gt;&amp;gt;&amp;gt; EventType[], Viewable[],
 ResultSetProcessor,&lt;br&gt;&amp;gt;&amp;gt; SelectClauseStreamSelectorEnum, StatementContext, List,&lt;br&gt;&amp;gt;&amp;gt; StreamJoinAnalysisResult)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.startSelect(boolean)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.start(boolean, boolean,&lt;br&gt;&amp;gt;&amp;gt; boolean)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.startInternal(String,&lt;br&gt;&amp;gt;&amp;gt; StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.start(String,&lt;br&gt;&amp;gt;&amp;gt; StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,&lt;br&gt;&amp;gt;&amp;gt; String, boolean, String, String, Map, Object, EPIsolationUnitServices)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,&lt;br&gt;&amp;gt;&amp;gt; String, boolean, String, Object,
 EPIsolationUnitServices)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel,&lt;br&gt;&amp;gt;&amp;gt; String)&lt;br&gt;&amp;gt;&amp;gt; com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel)&lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; There seems to be some sort of caveat in the &quot;computeBestPath&quot; method,&lt;br&gt;&amp;gt;&amp;gt; since it might have to try 15! combinations (in my case). Is that really&lt;br&gt;&amp;gt;&amp;gt; intented?&lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; Thanks a bunch,&lt;br&gt;&amp;gt;&amp;gt; Pedro&lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; -- &lt;br&gt;&amp;gt; View this message in context:&lt;/div&gt;&lt;span&gt;&amp;gt; &lt;a target=&quot;_blank&quot; href=&quot;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26709902.html&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26709902.html&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&amp;gt; Sent from the Esper User list mailing list archive at &lt;a target=&quot;_blank&quot; href=&quot;http://Nabble.com&quot; rel=&quot;nofollow&quot;&gt;Nabble.com&lt;/a&gt;.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; ---------------------------------------------------------------------&lt;br&gt;&amp;gt; To unsubscribe from this list, please visit:&lt;br&gt;&amp;gt; &lt;br&gt;&lt;span&gt;&amp;gt;&amp;nbsp; &amp;nbsp;  &lt;a target=&quot;_blank&quot; href=&quot;http://xircles.codehaus.org/manage_email&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;  &lt;br&gt;&amp;gt; &lt;br&gt;&lt;br&gt;-- &lt;br&gt;&lt;span&gt;View this message in context: &lt;a target=&quot;_blank&quot; href=&quot;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26715790.html&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26715790.html&lt;/a&gt;&lt;/span&gt;&lt;br&gt;Sent from the Esper User list mailing list archive at Nabble.com.&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------&lt;br&gt;To unsubscribe from this list, please visit:&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg1.c1.mail.mud.yahoo.com compressed/chunked Tue Dec  8 20:25:37 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26721410.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26715790</id>
	<title>Re: Stuck at NStreamQueryPlanBuilder.computeBestPath</title>
	<published>2009-12-09T11:04:41Z</published>
	<updated>2009-12-09T11:04:41Z</updated>
	<author>
		<name>pedroteixeira</name>
	</author>
	<content type="html">&lt;br&gt;&lt;br&gt;Thanks, Thomas. Will create a test case and then create the issue.
&lt;br&gt;&lt;br&gt;I'was reading the example in the docs:
&lt;br&gt;// Fast version, second alternative
&lt;br&gt;select 
&lt;br&gt;&amp;nbsp; (select avg(value) from MyEvent.win:length(100)) as avgA, 
&lt;br&gt;&amp;nbsp; (select avg(value) from MyEvent.win:length(50)) as avgB,
&lt;br&gt;&amp;nbsp; a.symbol
&lt;br&gt;from MyEvent.std:lastevent() a, MyEvent.std:lastevent() b
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;For a 15-stream join, is this the subquery approach that you meant?
&lt;br&gt;&lt;br&gt;select 
&lt;br&gt;&amp;nbsp; (select value from Event(id=1).std:lastevent()),
&lt;br&gt;&amp;nbsp; (select value from Event(id=2).std:lastevent()),
&lt;br&gt;...
&lt;br&gt;&amp;nbsp; (select value from Event(id=13).std:lastevent()),
&lt;br&gt;&amp;nbsp; j.value
&lt;br&gt;from Event(id=14).std.lastevent() as j
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;cheers,
&lt;br&gt;Pedro
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;Thomas Bernhardt wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;Hi,
&lt;br&gt;can you please create a JIRA and attach the test Java class.
&lt;br&gt;As a workaround to a 15-stream join consider subqueries.
&lt;br&gt;&lt;br&gt;&lt;br&gt;Best regards
&lt;br&gt;Tom
&lt;br&gt;&lt;br&gt;&lt;br&gt;________________________________
&lt;br&gt;From: pedroteixeira &amp;lt;pedro.t@gmail.com&amp;gt;
&lt;br&gt;To: user@esper.codehaus.org
&lt;br&gt;Sent: Wed, December 9, 2009 8:10:18 AM
&lt;br&gt;Subject: Re: [esper-user] Stuck at NStreamQueryPlanBuilder.computeBestPath
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;TYPO. The actual query is more like this:
&lt;br&gt;&lt;br&gt;select a.value, b.value, c.value ... j.value from Stream(id =
&lt;br&gt;1).std:lastevent() as a, Stream(id = 2).std:lastevent() as b, ..., Stream(id
&lt;br&gt;=10).std:lastevent() as j
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;pedroteixeira wrote:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Hello,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I've stumbled across a problem, but need some help to understand what it
&lt;br&gt;&amp;gt; is the intended behavior of the NStreamQueryPlanBuilder class. &amp;nbsp;Perhaps,
&lt;br&gt;&amp;gt; someone has already had this problem, but I was not able to find in the
&lt;br&gt;&amp;gt; archive.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I have a query which joins 10 streams in the following manner:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; select a.value, b.value, c.value ... j.value from Stream(id = 1) as a,
&lt;br&gt;&amp;gt; Stream(id = 2) as b, ..., Stream(id =10) as j
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; The esper engine gets stuck in the &amp;quot;computeBestPath&amp;quot; method, consuming one
&lt;br&gt;&amp;gt; of the CPUs allocated to the running thread. With yourkit, I extracted the
&lt;br&gt;&amp;gt; following stack trace:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; com.espertech.esper.collection.PermutationEnumeration.nextElement()
&lt;br&gt;&amp;gt; com.espertech.esper.collection.NumberSetPermutationEnumeration.nextElement()
&lt;br&gt;&amp;gt; com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.computeBestPath(int,
&lt;br&gt;&amp;gt; QueryGraph, HistoricalDependencyGraph)
&lt;br&gt;&amp;gt; com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.build(QueryGraph,
&lt;br&gt;&amp;gt; EventType[], boolean, boolean[], HistoricalDependencyGraph,
&lt;br&gt;&amp;gt; HistoricalStreamIndexList[])
&lt;br&gt;&amp;gt; com.espertech.esper.epl.join.plan.QueryPlanBuilder.getPlan(EventType[],
&lt;br&gt;&amp;gt; List, QueryGraph, String[], boolean, boolean[],
&lt;br&gt;&amp;gt; HistoricalDependencyGraph, HistoricalStreamIndexList[],
&lt;br&gt;&amp;gt; ExprEvaluatorContext)
&lt;br&gt;&amp;gt; com.espertech.esper.epl.join.JoinSetComposerFactoryImpl.makeComposer(List,
&lt;br&gt;&amp;gt; ExprNode, EventType[], String[], Viewable[],
&lt;br&gt;&amp;gt; SelectClauseStreamSelectorEnum, StreamJoinAnalysisResult,
&lt;br&gt;&amp;gt; ExprEvaluatorContext)
&lt;br&gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.handleJoin(String[],
&lt;br&gt;&amp;gt; EventType[], Viewable[], ResultSetProcessor,
&lt;br&gt;&amp;gt; SelectClauseStreamSelectorEnum, StatementContext, List,
&lt;br&gt;&amp;gt; StreamJoinAnalysisResult)
&lt;br&gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.startSelect(boolean)
&lt;br&gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.start(boolean, boolean,
&lt;br&gt;&amp;gt; boolean)
&lt;br&gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.startInternal(String,
&lt;br&gt;&amp;gt; StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)
&lt;br&gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.start(String,
&lt;br&gt;&amp;gt; StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)
&lt;br&gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,
&lt;br&gt;&amp;gt; String, boolean, String, String, Map, Object, EPIsolationUnitServices)
&lt;br&gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,
&lt;br&gt;&amp;gt; String, boolean, String, Object, EPIsolationUnitServices)
&lt;br&gt;&amp;gt; com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel,
&lt;br&gt;&amp;gt; String)
&lt;br&gt;&amp;gt; com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel)
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; There seems to be some sort of caveat in the &amp;quot;computeBestPath&amp;quot; method,
&lt;br&gt;&amp;gt; since it might have to try 15! combinations (in my case). Is that really
&lt;br&gt;&amp;gt; intented?
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks a bunch,
&lt;br&gt;&amp;gt; Pedro
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&lt;br&gt;-- 
&lt;br&gt;View this message in context: &lt;a href=&quot;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26709902.html&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26709902.html&lt;/a&gt;&lt;br&gt;Sent from the Esper User list mailing list archive at Nabble.com.
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; 
&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26715790.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26714138</id>
	<title>Re: Stuck at NStreamQueryPlanBuilder.computeBestPath</title>
	<published>2009-12-09T09:28:00Z</published>
	<updated>2009-12-09T09:28:00Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div&gt;Hi,&lt;br&gt;can you please create a JIRA and attach the test Java class.&lt;br&gt;As a workaround to a 15-stream join consider subqueries.&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;&lt;br&gt;Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 13px;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; pedroteixeira &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26714138&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;pedro.t@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26714138&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Wed, December 9, 2009 8:10:18 AM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] Stuck at NStreamQueryPlanBuilder.computeBestPath&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;br&gt;&lt;br&gt;TYPO. The actual query is more like this:&lt;br&gt;&lt;br&gt;select a.value, b.value, c.value ... j.value from Stream(id =&lt;br&gt;1).std:lastevent() as a, Stream(id = 2).std:lastevent() as b, ..., Stream(id&lt;br&gt;=10).std:lastevent() as j&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;pedroteixeira wrote:&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Hello,&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; I've stumbled across a problem, but need some help to understand what it&lt;br&gt;&amp;gt; is the intended behavior of the NStreamQueryPlanBuilder class.&amp;nbsp; Perhaps,&lt;br&gt;&amp;gt; someone has already had this problem, but I was not able to find in the&lt;br&gt;&amp;gt; archive.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; I have a query which joins 10 streams in the following manner:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; select a.value, b.value, c.value ... j.value from Stream(id = 1) as a,&lt;br&gt;&amp;gt; Stream(id = 2) as b, ..., Stream(id =10) as j&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; The esper engine gets stuck in the &quot;computeBestPath&quot; method, consuming one&lt;br&gt;&amp;gt; of the CPUs allocated to the running thread. With yourkit,
 I extracted the&lt;br&gt;&amp;gt; following stack trace:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; com.espertech.esper.collection.PermutationEnumeration.nextElement()&lt;br&gt;&amp;gt; com.espertech.esper.collection.NumberSetPermutationEnumeration.nextElement()&lt;br&gt;&amp;gt; com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.computeBestPath(int,&lt;br&gt;&amp;gt; QueryGraph, HistoricalDependencyGraph)&lt;br&gt;&amp;gt; com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.build(QueryGraph,&lt;br&gt;&amp;gt; EventType[], boolean, boolean[], HistoricalDependencyGraph,&lt;br&gt;&amp;gt; HistoricalStreamIndexList[])&lt;br&gt;&amp;gt; com.espertech.esper.epl.join.plan.QueryPlanBuilder.getPlan(EventType[],&lt;br&gt;&amp;gt; List, QueryGraph, String[], boolean, boolean[],&lt;br&gt;&amp;gt; HistoricalDependencyGraph, HistoricalStreamIndexList[],&lt;br&gt;&amp;gt; ExprEvaluatorContext)&lt;br&gt;&amp;gt; com.espertech.esper.epl.join.JoinSetComposerFactoryImpl.makeComposer(List,&lt;br&gt;&amp;gt; ExprNode, EventType[], String[], Viewable[],&lt;br&gt;&amp;gt; SelectClauseStreamSelectorEnum,
 StreamJoinAnalysisResult,&lt;br&gt;&amp;gt; ExprEvaluatorContext)&lt;br&gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.handleJoin(String[],&lt;br&gt;&amp;gt; EventType[], Viewable[], ResultSetProcessor,&lt;br&gt;&amp;gt; SelectClauseStreamSelectorEnum, StatementContext, List,&lt;br&gt;&amp;gt; StreamJoinAnalysisResult)&lt;br&gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.startSelect(boolean)&lt;br&gt;&amp;gt; com.espertech.esper.core.EPStatementStartMethod.start(boolean, boolean,&lt;br&gt;&amp;gt; boolean)&lt;br&gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.startInternal(String,&lt;br&gt;&amp;gt; StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)&lt;br&gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.start(String,&lt;br&gt;&amp;gt; StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)&lt;br&gt;&amp;gt; com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,&lt;br&gt;&amp;gt; String, boolean, String, String, Map, Object, EPIsolationUnitServices)&lt;br&gt;&amp;gt;
 com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,&lt;br&gt;&amp;gt; String, boolean, String, Object, EPIsolationUnitServices)&lt;br&gt;&amp;gt; com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel,&lt;br&gt;&amp;gt; String)&lt;br&gt;&amp;gt; com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel)&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; There seems to be some sort of caveat in the &quot;computeBestPath&quot; method,&lt;br&gt;&amp;gt; since it might have to try 15! combinations (in my case). Is that really&lt;br&gt;&amp;gt; intented?&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Thanks a bunch,&lt;br&gt;&amp;gt; Pedro&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;/div&gt;&lt;br&gt;-- &lt;br&gt;&lt;span&gt;View this message in context: &lt;a target=&quot;_blank&quot; href=&quot;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26709902.html&quot; rel=&quot;nofollow&quot;&gt;http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26709902.html&lt;/a&gt;&lt;/span&gt;&lt;br&gt;Sent from the Esper User list mailing list archive at &lt;a target=&quot;_blank&quot; href=&quot;http://Nabble.com&quot; rel=&quot;nofollow&quot;&gt;Nabble.com&lt;/a&gt;.&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------&lt;br&gt;To unsubscribe from this list, please visit:&lt;br&gt;&lt;br&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://xircles.codehaus.org/manage_email&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg1.c1.mail.mud.yahoo.com compressed/chunked Tue Dec  8 20:25:37 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;



      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26714138.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26709902</id>
	<title>Re: Stuck at NStreamQueryPlanBuilder.computeBestPath</title>
	<published>2009-12-09T05:10:18Z</published>
	<updated>2009-12-09T05:10:18Z</updated>
	<author>
		<name>pedroteixeira</name>
	</author>
	<content type="html">&lt;br&gt;TYPO. The actual query is more like this:
&lt;br&gt;&lt;br&gt;select a.value, b.value, c.value ... j.value from Stream(id = 1).std:lastevent() as a, Stream(id = 2).std:lastevent() as b, ..., Stream(id =10).std:lastevent() as j
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;blockquote class=&quot;quote light-black dark-border-color&quot;&gt;&lt;div class=&quot;quote light-border-color&quot;&gt;
&lt;div class=&quot;quote-author&quot; style=&quot;font-weight: bold;&quot;&gt;pedroteixeira wrote:&lt;/div&gt;
&lt;div class=&quot;quote-message shrinkable-quote&quot;&gt;Hello,
&lt;br&gt;&lt;br&gt;I've stumbled across a problem, but need some help to understand what it is the intended behavior of the NStreamQueryPlanBuilder class. &amp;nbsp;Perhaps, someone has already had this problem, but I was not able to find in the archive.
&lt;br&gt;&lt;br&gt;&lt;br&gt;I have a query which joins 10 streams in the following manner:
&lt;br&gt;&lt;br&gt;select a.value, b.value, c.value ... j.value from Stream(id = 1) as a, Stream(id = 2) as b, ..., Stream(id =10) as j
&lt;br&gt;&lt;br&gt;&lt;br&gt;The esper engine gets stuck in the &amp;quot;computeBestPath&amp;quot; method, consuming one of the CPUs allocated to the running thread. With yourkit, I extracted the following stack trace:
&lt;br&gt;&lt;br&gt;&lt;br&gt;com.espertech.esper.collection.PermutationEnumeration.nextElement()
&lt;br&gt;com.espertech.esper.collection.NumberSetPermutationEnumeration.nextElement()
&lt;br&gt;com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.computeBestPath(int,
&lt;br&gt;QueryGraph, HistoricalDependencyGraph)
&lt;br&gt;com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.build(QueryGraph,
&lt;br&gt;EventType[], boolean, boolean[], HistoricalDependencyGraph,
&lt;br&gt;HistoricalStreamIndexList[])
&lt;br&gt;com.espertech.esper.epl.join.plan.QueryPlanBuilder.getPlan(EventType[],
&lt;br&gt;List, QueryGraph, String[], boolean, boolean[],
&lt;br&gt;HistoricalDependencyGraph, HistoricalStreamIndexList[],
&lt;br&gt;ExprEvaluatorContext)
&lt;br&gt;com.espertech.esper.epl.join.JoinSetComposerFactoryImpl.makeComposer(List,
&lt;br&gt;ExprNode, EventType[], String[], Viewable[],
&lt;br&gt;SelectClauseStreamSelectorEnum, StreamJoinAnalysisResult,
&lt;br&gt;ExprEvaluatorContext)
&lt;br&gt;com.espertech.esper.core.EPStatementStartMethod.handleJoin(String[],
&lt;br&gt;EventType[], Viewable[], ResultSetProcessor,
&lt;br&gt;SelectClauseStreamSelectorEnum, StatementContext, List,
&lt;br&gt;StreamJoinAnalysisResult)
&lt;br&gt;com.espertech.esper.core.EPStatementStartMethod.startSelect(boolean)
&lt;br&gt;com.espertech.esper.core.EPStatementStartMethod.start(boolean, boolean, boolean)
&lt;br&gt;com.espertech.esper.core.StatementLifecycleSvcImpl.startInternal(String,
&lt;br&gt;StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)
&lt;br&gt;com.espertech.esper.core.StatementLifecycleSvcImpl.start(String,
&lt;br&gt;StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)
&lt;br&gt;com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,
&lt;br&gt;String, boolean, String, String, Map, Object, EPIsolationUnitServices)
&lt;br&gt;com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,
&lt;br&gt;String, boolean, String, Object, EPIsolationUnitServices)
&lt;br&gt;com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel,
&lt;br&gt;String)
&lt;br&gt;com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel)
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;There seems to be some sort of caveat in the &amp;quot;computeBestPath&amp;quot; method, since it might have to try 15! combinations (in my case). Is that really intented?
&lt;br&gt;&lt;br&gt;Thanks a bunch,
&lt;br&gt;Pedro
&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;&lt;/blockquote&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26709902.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26709887</id>
	<title>Stuck at NStreamQueryPlanBuilder.computeBestPath</title>
	<published>2009-12-09T05:08:58Z</published>
	<updated>2009-12-09T05:08:58Z</updated>
	<author>
		<name>pedroteixeira</name>
	</author>
	<content type="html">&lt;br&gt;Hello,
&lt;br&gt;&lt;br&gt;I've stumbled across a problem, but need some help to understand what it is the intended behavior of the NStreamQueryPlanBuilder class. &amp;nbsp;Perhaps, someone has already had this problem, but I was not able to find in the archive.
&lt;br&gt;&lt;br&gt;&lt;br&gt;I have a query which joins 10 streams in the following manner:
&lt;br&gt;&lt;br&gt;select a.value, b.value, c.value ... j.value from Stream(id = 1) as a, Stream(id = 2) as b, ..., Stream(id =10) as j
&lt;br&gt;&lt;br&gt;&lt;br&gt;The esper engine gets stuck in the &amp;quot;computeBestPath&amp;quot; method, consuming one of the CPUs allocated to the running thread. With yourkit, I extracted the following stack trace:
&lt;br&gt;&lt;br&gt;&lt;br&gt;com.espertech.esper.collection.PermutationEnumeration.nextElement()
&lt;br&gt;com.espertech.esper.collection.NumberSetPermutationEnumeration.nextElement()
&lt;br&gt;com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.computeBestPath(int,
&lt;br&gt;QueryGraph, HistoricalDependencyGraph)
&lt;br&gt;com.espertech.esper.epl.join.plan.NStreamQueryPlanBuilder.build(QueryGraph,
&lt;br&gt;EventType[], boolean, boolean[], HistoricalDependencyGraph,
&lt;br&gt;HistoricalStreamIndexList[])
&lt;br&gt;com.espertech.esper.epl.join.plan.QueryPlanBuilder.getPlan(EventType[],
&lt;br&gt;List, QueryGraph, String[], boolean, boolean[],
&lt;br&gt;HistoricalDependencyGraph, HistoricalStreamIndexList[],
&lt;br&gt;ExprEvaluatorContext)
&lt;br&gt;com.espertech.esper.epl.join.JoinSetComposerFactoryImpl.makeComposer(List,
&lt;br&gt;ExprNode, EventType[], String[], Viewable[],
&lt;br&gt;SelectClauseStreamSelectorEnum, StreamJoinAnalysisResult,
&lt;br&gt;ExprEvaluatorContext)
&lt;br&gt;com.espertech.esper.core.EPStatementStartMethod.handleJoin(String[],
&lt;br&gt;EventType[], Viewable[], ResultSetProcessor,
&lt;br&gt;SelectClauseStreamSelectorEnum, StatementContext, List,
&lt;br&gt;StreamJoinAnalysisResult)
&lt;br&gt;com.espertech.esper.core.EPStatementStartMethod.startSelect(boolean)
&lt;br&gt;com.espertech.esper.core.EPStatementStartMethod.start(boolean, boolean, boolean)
&lt;br&gt;com.espertech.esper.core.StatementLifecycleSvcImpl.startInternal(String,
&lt;br&gt;StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)
&lt;br&gt;com.espertech.esper.core.StatementLifecycleSvcImpl.start(String,
&lt;br&gt;StatementLifecycleSvcImpl$EPStatementDesc, boolean, boolean, boolean)
&lt;br&gt;com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,
&lt;br&gt;String, boolean, String, String, Map, Object, EPIsolationUnitServices)
&lt;br&gt;com.espertech.esper.core.StatementLifecycleSvcImpl.createAndStart(StatementSpecRaw,
&lt;br&gt;String, boolean, String, Object, EPIsolationUnitServices)
&lt;br&gt;com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel,
&lt;br&gt;String)
&lt;br&gt;com.espertech.esper.core.EPAdministratorImpl.create(EPStatementObjectModel)
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;There seems to be some sort of caveat in the &amp;quot;computeBestPath&amp;quot; method, since it might have to try 15! combinations (in my case). Is that really intented?
&lt;br&gt;&lt;br&gt;Thanks a bunch,
&lt;br&gt;Pedro
&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Stuck-at-NStreamQueryPlanBuilder.computeBestPath-tp26709887p26709887.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26708594</id>
	<title>Re: Retrieving events prior an event</title>
	<published>2009-12-09T03:12:41Z</published>
	<updated>2009-12-09T03:12:41Z</updated>
	<author>
		<name>Cédric Moonen</name>
	</author>
	<content type="html">&lt;html&gt;
&lt;body&gt;
I made a mistake in my previous reply. The statement that is working
looks like this in fact:&lt;br&gt;
select * from B as evtB unidirectional, pattern[every evtA=A -&amp;gt; A
-&amp;gt; A -&amp;gt; A -&amp;gt; A]&lt;br&gt;&lt;br&gt;
Which is even more ugly...&lt;br&gt;&lt;br&gt;
I've been looking at the mathc_recognize but as I expected I am a bit
stuck on detecting the type of the event in the define clause. What I
have so far is:&lt;br&gt;&lt;br&gt;
select * from BaseEvent&lt;br&gt;
match_recognize (&lt;br&gt;
&amp;nbsp; measures A as start, B as stop&lt;br&gt;
&amp;nbsp; pattern(A X X X X B)&lt;br&gt;
&amp;nbsp; define &lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; B as (??? AND B.var1=&amp;quot;Val1&amp;quot; AND
B.var2=&amp;quot;Val2&amp;quot; ) &lt;br&gt;
)&lt;br&gt;&lt;br&gt;
So, to summarize, both A and B inherit from BaseEvent. The
&amp;quot;???&amp;quot; in the define should be replaced by something that
specifies the type of the event B (event A can be of any type). var1 and
var2 are both members of the more derived type which B is representing.
Is there any way to do this ?&lt;br&gt;&lt;br&gt;
Thanks for any feedback.&lt;br&gt;
Cédric&lt;br&gt;&lt;br&gt;
&lt;br&gt;
At 11:02 9/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=cite class=cite cite=&quot;&quot;&gt;Hello Thomas,&lt;br&gt;&lt;br&gt;
I've looked at the documentation of Esper 3.2 and this is a new feature
(we were still using 3.1). It looks indeed very promising to use the
match-recognize. I will have to experiment with it but I think what might
be a problem (not sure for now) is that you can only work with one type
of events. Luckily, all our events have the same common base class so
there is probably a work around here if we are able to specify a more
defined type in the define clause. Is that possible ?&lt;br&gt;
By the way, I realized that I made a small mistake in my previous
example: what should be retrieved is &amp;quot;A3 B1&amp;quot; and &amp;quot;A12
B2&amp;quot; (and not &amp;quot;A12 B1&amp;quot;), sorry for the confusion.&lt;br&gt;
&lt;br&gt;
Out of curiosity, is there a way to achieve this without using the
match-recognize ? Any way using the prev or prior function ?&lt;br&gt;&lt;br&gt;
There is a way but it is really ugly and I really would like to find an
easier solution. Here is what we have right now:&lt;br&gt;
select * from B as evtB unidirectional, pattern[every A[5] as
evtA]&lt;br&gt;&lt;br&gt;
This seems to work fine but it is really complex. Any other better
looking way :-) ?&lt;br&gt;&lt;br&gt;
Thanks&lt;br&gt;
Cédric&lt;br&gt;&lt;br&gt;
&lt;br&gt;
At 19:24 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=cite class=cite cite=&quot;&quot;&gt;Hi Cedrik,&lt;br&gt;&lt;br&gt;
here is a possible match-recognize (the regular expression only):&lt;br&gt;
- A3 B1:&amp;nbsp; (A X X X X B), select A and B&lt;br&gt;
- A12 B1:&amp;nbsp; (B X X X X A), select A and B&amp;nbsp; &lt;br&gt;&lt;br&gt;
or both at the same time &amp;quot;(A X X X X B) | (B X X X X
A)&amp;quot;&lt;br&gt;&lt;br&gt;
Best regards&lt;br&gt;
Tom&lt;br&gt;&lt;br&gt;
&lt;font face=&quot;Tahoma&quot; size=2&gt;&lt;b&gt;From:&lt;/b&gt; Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26708594&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&lt;b&gt;To:&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26708594&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Sent:&lt;/b&gt; Tue, December 8, 2009 9:07:18 AM&lt;br&gt;
&lt;b&gt;Subject:&lt;/b&gt; Re: [esper-user] Retrieving events prior an event&lt;br&gt;
&lt;/font&gt;&lt;br&gt;
Thanks for the reply,&lt;br&gt;&lt;br&gt;
But I don't think this will really solve my problem. Let me show you with
an example, which will probably be clearer than my explanation. Suppose
the following sequence of events:&lt;br&gt;
A1 A2 A3 A4 A5 A6 A7 B1 A8 A9 A10 A11 A12 A13 A14 A15 A16 B2 A17
A18&lt;br&gt;&lt;br&gt;
What I want to retrieve is:&lt;br&gt;
- A3 B1 (A3 being the fifth A event before B10)&lt;br&gt;
- A12 B1&lt;br&gt;&lt;br&gt;
I don't think this is really feasible using a pattern, is it ?&amp;nbsp;
&lt;br&gt;&lt;br&gt;
At 14:51 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=cite class=cite cite=&quot;&quot;&gt;May be a pattern using repeat or
repeat until would be a better way?&lt;br&gt;&lt;br&gt;
2009/12/8 Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26708594&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt; &amp;gt; 
&lt;dl&gt;
&lt;dd&gt;Hello,
&lt;dd&gt;I'm a bit stuck with a problem when trying to retrieve events that
happened before a specific event. My scenario is that I have events
coming in and all those events have the same base event (let's call it
BaseEvent). Then, there are some specific events that I am looking for
(SpecificEvent). I need to retrieve all those specific events with the
base event that occured 5th-prior that specific event.
&lt;dd&gt;The first thing I did was something like this: 
&lt;dd&gt;select * from SpecificEvent as event unidirectional,
BaseEvent.win:length(5).std:firstevent() as prevEvent
&lt;dd&gt;But this didn't work as I expected and looking at the documentation
of the std:firstevent, it is explained there that I should use the prev
function instead because the window is restarted each time. So, I tried
then to use the prev function but there's no explanation in the doc on
how I have to specify that I want the full event and not one of the
properties (although, it is stated that it should be possible). I tried
to write something like this:
&lt;dd&gt;select event, prev(5, *) as prevEvent from SpecificEvent as event
unidirectional, BaseEvent.win:length(5)
&lt;dd&gt;But it complains about the syntax error for the '*' symbol.
&lt;dd&gt;So my questions are: 
&lt;dd&gt;1) How to write suche a statement ? 
&lt;dd&gt;2) If there are multiple streams, how will the prev function
&amp;quot;know&amp;quot; for which stream it has to select the event ?
&lt;dd&gt;I'm a bit confused with this prev function.
&lt;dd&gt;Thanks for your feedback. 
&lt;dd&gt;Cédric&lt;br&gt;

&lt;dd&gt;--------------------------------------------------------------------- 
&lt;dd&gt;To unsubscribe from this list, please visit:
&lt;dd&gt;&amp;nbsp;
&lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;
http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;/blockquote&gt;
&lt;/dl&gt;Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26708594&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.fmtc.be/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;www.fmtc.be&lt;/a&gt;&lt;/blockquote&gt;&lt;br&gt;
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&lt;x-tab&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26708594&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&lt;x-tab&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.fmtc.be/&quot; eudora=&quot;autourl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;www.fmtc.be&lt;/a&gt;
&lt;/blockquote&gt;
&lt;x-sigsep&gt;&lt;p&gt;&lt;/x-sigsep&gt;
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&lt;x-tab&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26708594&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&lt;x-tab&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.fmtc.be/&quot; eudora=&quot;autourl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;www.fmtc.be&lt;br&gt;
&lt;/a&gt;&lt;/body&gt;
&lt;/html&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Retrieving-events-prior-an-event-tp26691705p26708594.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26707756</id>
	<title>Re: Retrieving events prior an event</title>
	<published>2009-12-09T02:02:00Z</published>
	<updated>2009-12-09T02:02:00Z</updated>
	<author>
		<name>Cédric Moonen</name>
	</author>
	<content type="html">&lt;html&gt;
&lt;body&gt;
Hello Thomas,&lt;br&gt;&lt;br&gt;
I've looked at the documentation of Esper 3.2 and this is a new feature
(we were still using 3.1). It looks indeed very promising to use the
match-recognize. I will have to experiment with it but I think what might
be a problem (not sure for now) is that you can only work with one type
of events. Luckily, all our events have the same common base class so
there is probably a work around here if we are able to specify a more
defined type in the define clause. Is that possible ?&lt;br&gt;
By the way, I realized that I made a small mistake in my previous
example: what should be retrieved is &amp;quot;A3 B1&amp;quot; and &amp;quot;A12
B2&amp;quot; (and not &amp;quot;A12 B1&amp;quot;), sorry for the confusion.&lt;br&gt;&lt;br&gt;
Out of curiosity, is there a way to achieve this without using the
match-recognize ? Any way using the prev or prior function ?&lt;br&gt;&lt;br&gt;
There is a way but it is really ugly and I really would like to find an
easier solution. Here is what we have right now:&lt;br&gt;
select * from B as evtB unidirectional, pattern[every A[5] as
evtA]&lt;br&gt;&lt;br&gt;
This seems to work fine but it is really complex. Any other better
looking way :-) ?&lt;br&gt;&lt;br&gt;
Thanks&lt;br&gt;
Cédric&lt;br&gt;&lt;br&gt;
&lt;br&gt;
At 19:24 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=cite class=cite cite=&quot;&quot;&gt;Hi Cedrik,&lt;br&gt;&lt;br&gt;
here is a possible match-recognize (the regular expression only):&lt;br&gt;
- A3 B1:&amp;nbsp; (A X X X X B), select A and B&lt;br&gt;
- A12 B1:&amp;nbsp; (B X X X X A), select A and B&amp;nbsp; &lt;br&gt;&lt;br&gt;
or both at the same time &amp;quot;(A X X X X B) | (B X X X X
A)&amp;quot;&lt;br&gt;&lt;br&gt;
Best regards&lt;br&gt;
Tom&lt;br&gt;
&lt;br&gt;
&lt;font face=&quot;Tahoma&quot; size=2&gt;&lt;b&gt;From:&lt;/b&gt; Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26707756&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&lt;b&gt;To:&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26707756&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;
&lt;b&gt;Sent:&lt;/b&gt; Tue, December 8, 2009 9:07:18 AM&lt;br&gt;
&lt;b&gt;Subject:&lt;/b&gt; Re: [esper-user] Retrieving events prior an event&lt;br&gt;
&lt;/font&gt;&lt;br&gt;
Thanks for the reply,&lt;br&gt;&lt;br&gt;
But I don't think this will really solve my problem. Let me show you with
an example, which will probably be clearer than my explanation. Suppose
the following sequence of events:&lt;br&gt;
A1 A2 A3 A4 A5 A6 A7 B1 A8 A9 A10 A11 A12 A13 A14 A15 A16 B2 A17
A18&lt;br&gt;&lt;br&gt;
What I want to retrieve is:&lt;br&gt;
- A3 B1 (A3 being the fifth A event before B10)&lt;br&gt;
- A12 B1&lt;br&gt;&lt;br&gt;
I don't think this is really feasible using a pattern, is it ?&amp;nbsp;
&lt;br&gt;&lt;br&gt;
At 14:51 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=cite class=cite cite=&quot;&quot;&gt;May be a pattern using repeat or
repeat until would be a better way?&lt;br&gt;&lt;br&gt;
2009/12/8 Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26707756&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;
&amp;gt;
&lt;dl&gt;
&lt;dd&gt;Hello,&lt;br&gt;

&lt;dd&gt;I'm a bit stuck with a problem when trying to retrieve events that
happened before a specific event. My scenario is that I have events
coming in and all those events have the same base event (let's call it
BaseEvent). Then, there are some specific events that I am looking for
(SpecificEvent). I need to retrieve all those specific events with the
base event that occured 5th-prior that specific event.&lt;br&gt;

&lt;dd&gt;The first thing I did was something like this:
&lt;dd&gt;select * from SpecificEvent as event unidirectional,
BaseEvent.win:length(5).std:firstevent() as prevEvent&lt;br&gt;

&lt;dd&gt;But this didn't work as I expected and looking at the documentation
of the std:firstevent, it is explained there that I should use the prev
function instead because the window is restarted each time. So, I tried
then to use the prev function but there's no explanation in the doc on
how I have to specify that I want the full event and not one of the
properties (although, it is stated that it should be possible). I tried
to write something like this:&lt;br&gt;

&lt;dd&gt;select event, prev(5, *) as prevEvent from SpecificEvent as event
unidirectional, BaseEvent.win:length(5)&lt;br&gt;

&lt;dd&gt;But it complains about the syntax error for the '*' symbol.&lt;br&gt;

&lt;dd&gt;So my questions are:
&lt;dd&gt;1) How to write suche a statement ?
&lt;dd&gt;2) If there are multiple streams, how will the prev function
&amp;quot;know&amp;quot; for which stream it has to select the event ?&lt;br&gt;

&lt;dd&gt;I'm a bit confused with this prev function.&lt;br&gt;

&lt;dd&gt;Thanks for your feedback.
&lt;dd&gt;Cédric&lt;br&gt;
&lt;br&gt;

&lt;dd&gt;
---------------------------------------------------------------------
&lt;dd&gt;To unsubscribe from this list, please visit:&lt;br&gt;

&lt;dd&gt;&amp;nbsp;
&lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;
http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;
&lt;/dl&gt;Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26707756&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.fmtc.be/&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;www.fmtc.be&lt;br&gt;
&lt;/a&gt;&lt;/blockquote&gt;
&lt;x-sigsep&gt;&lt;p&gt;&lt;/x-sigsep&gt;
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&lt;x-tab&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26707756&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&lt;x-tab&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.fmtc.be/&quot; eudora=&quot;autourl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;www.fmtc.be&lt;br&gt;
&lt;/a&gt;&lt;/body&gt;
&lt;/html&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Retrieving-events-prior-an-event-tp26691705p26707756.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26704250</id>
	<title>Re: match_recognize clause with aggregations</title>
	<published>2009-12-08T18:34:09Z</published>
	<updated>2009-12-08T18:34:09Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;Yes the define-clause does not allow aggregation functions, we'll update the doc and improve error handling.&lt;br&gt;&lt;br&gt;Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: times new roman,new york,times,serif; font-size: 12pt;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; Sandeep Poreddy &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26704250&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;sandeep.poreddy@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26704250&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Tue, December 8, 2009 1:06:57 PM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; [esper-user] match_recognize clause with aggregations&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;off&quot;&gt;


 
 




&lt;div class=&quot;Section1&quot;&gt;

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt;Hello, &lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt;Need some help with match_recognize clause. &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt;Consider the following EPL:&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;stmt2 = &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;id,&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;outsideTemp,&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;timestamp1,tempString&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size:
 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;FROM&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;OutputEventsOne&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp;match_recognize( &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; measures &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://A.id&quot; rel=&quot;nofollow&quot;&gt;A.id&lt;/a&gt;&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;id,&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;A.outsideTemp&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier
 New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;outsideTemp,&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
A.timestamp1 &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;a_timestamp1,&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;sum(B.timestamp1&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;A.timestamp1)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt;
 font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;timestamp1,&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;A.tempString&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;tempString&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; all &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;matches&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; after &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;match&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;skip&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;to&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;current&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt;
 font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;row&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pattern &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;A&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;B+)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; define &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;A &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;(A.tempString&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;'LESS'&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;as&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;B.tempString&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; = &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;'LESS')&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;sum(B.timestamp1&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;-&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;A.timestamp1)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: black;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;&amp;gt;3000);&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt;The statement gets registered with the esper engine without any
problem. But an exception is thrown when I run the application. I see that no
exception is thrown when I remove the aggregate ‘sum’ from the
statement. &lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt;Is it not legal to use aggregations in the define part of match
recognize clause?.&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: rgb(42, 0, 255);&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;SEVERE: ##&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;com.espertech.esper.client.EPException&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;Caused by: &lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;java.lang.NullPointerException&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.epl.expression.ExprAggregateNode.evaluate(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;ExprAggregateNode.java:136&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.epl.expression.ExprRelationalOpNode.evaluate(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;ExprRelationalOpNode.java:92&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.epl.expression.ExprAndNode.evaluate(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;ExprAndNode.java:58&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.rowregex.RegexNFAStateOneToMany.matches(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;RegexNFAStateOneToMany.java:36&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.rowregex.EventRowRegexNFAView.step(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;EventRowRegexNFAView.java:792&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.rowregex.EventRowRegexNFAView.update(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;EventRowRegexNFAView.java:305&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.view.ZeroDepthStream.insert(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;ZeroDepthStream.java:70&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.view.stream.StreamFactorySvcImpl$2.matchFound(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;StreamFactorySvcImpl.java:166&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.core.EPRuntimeImpl.processStatementFilterSingle(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;EPRuntimeImpl.java:1031&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.core.EPRuntimeImpl.processMatches(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;EPRuntimeImpl.java:824&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot; style=&quot;&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.core.EPRuntimeImpl.processWrappedEvent(&lt;/span&gt;&lt;u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: navy;&quot;&gt;EPRuntimeImpl.java:398&lt;/span&gt;&lt;/u&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;;&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 10pt; font-family: &amp;quot;Courier New&amp;quot;; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... 11 more&lt;/span&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt;Thanks,&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;; color: rgb(31, 73, 125);&quot;&gt;Sandeep&lt;/span&gt;&lt;/p&gt; 

&lt;p class=&quot;MsoNormal&quot;&gt;&lt;span style=&quot;font-size: 11pt; font-family: &amp;quot;Calibri&amp;quot;,&amp;quot;sans-serif&amp;quot;;&quot;&gt; &amp;nbsp;&lt;/span&gt;&lt;/p&gt; 

&lt;/div&gt;

&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;on&quot;&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg19.c1.mail.mud.yahoo.com compressed/chunked Tue Dec  8 10:13:34 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/match_recognize-clause-with-aggregations-tp26698067p26704250.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26704200</id>
	<title>Re: Real-time hierarchical aggregated statistics</title>
	<published>2009-12-08T18:27:12Z</published>
	<updated>2009-12-08T18:27:12Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;Do you want to provide a little test class to use, with the SQL removed, we can look into. &lt;br&gt;&lt;br&gt;Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: times new roman,new york,times,serif; font-size: 12pt;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; António Alegria &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26704200&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26704200&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Tue, December 8, 2009 4:20:57 PM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] Real-time hierarchical aggregated statistics&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;off&quot;&gt;The SQL fires only once (the pattern has no every) and the named window is a keepall, yes. That query does not return too many rows though.&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Dec 6, 2009 at 9:32 PM, Thomas Bernhardt &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26704200&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bernhardttom@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;&lt;div&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;
I'd recommend reading up on the performance tips in the section.&lt;br&gt;The named window is a keep-all policy and retains all events? You may want to retain only the last event per id.&lt;br&gt;The SQL query fires every 1 seconds and fills the named window?&lt;br&gt;
Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: times new roman,new york,times,serif; font-size: 12pt;&quot;&gt;&lt;div class=&quot;im&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; António Alegria &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26704200&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26704200&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Fri, December 4, 2009 6:43:56 AM&lt;br&gt;
&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user]
 Real-time hierarchical aggregated statistics&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;Well, with 10 &quot;StockTick&quot; events per second esper starts to fall behind in updating all the tree in real time. My interest here is in to know if there is a more intelligent way to approaching this problem or if this is as good as it gets.&lt;br&gt;

&lt;br&gt;Thanks,&lt;br&gt;&lt;br&gt;António Alegria&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Dec 3, 2009 at 9:27 PM, Alexandre Vasseur &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26704200&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avasseur@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
What do you mean exactly with &quot;isn't scalable&quot; and &quot;ineficient&quot; ?&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/3 António Alegria &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26704200&amp;i=6&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;div&gt;

&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hi, we have the following problem we are trying to solve with Esper. We have, in fact, reached a solution but it isn't scalable. The problem has nothing to do with the stockmarket but I will present it as such.&lt;div&gt;



&lt;br&gt;&lt;/div&gt;&lt;div&gt;Suppose Esper receives several StockTick events, with the following fields:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;StockTick:&lt;/div&gt;&lt;div&gt;* symbol: string (e.g. &quot;MSFT&quot;, &quot;APPL&quot;, &quot;GOOG&quot;, ...)&lt;/div&gt;





&lt;div&gt;* price: float&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Furthermore, each StockTick symbol can be associated with grouping hierarchy, such as business field, city, region, country, continent. This grouping information is collected from an SQL query and put in a named window with the following fields:&lt;/div&gt;





&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;GroupTree:&lt;/div&gt;&lt;div&gt;* group: string&lt;/div&gt;&lt;div&gt;* member: string&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example events in this named windows are: [&quot;USA&quot;, &quot;Washington&quot;], [&quot;Washington&quot;, &quot;Redmond&quot;], [&quot;IT&quot;, &quot;MSFT&quot;].&lt;/div&gt;





&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;We want to develop EPL rules that, in real-time and for each arriving StockTick, calculate the average price for each category in this grouping hierarchy (e.g. average for each country, each region, etc...).&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;You can see our current (ineficient solution) in &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://gist.github.com/f1bec8803ee7de907570&quot;&gt;https://gist.github.com/f1bec8803ee7de907570&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I would greatly appreciate it if someone could tell me the &quot;right way&quot; to do this.&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;div&gt;António Alegria&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/div&gt;&lt;br&gt;

      &lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;on&quot;&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg19.c1.mail.mud.yahoo.com compressed/chunked Tue Dec  8 10:13:34 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Real-time-hierarchical-aggregated-statistics-tp26631575p26704200.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26700986</id>
	<title>Re: Real-time hierarchical aggregated statistics</title>
	<published>2009-12-08T13:20:57Z</published>
	<updated>2009-12-08T13:20:57Z</updated>
	<author>
		<name>António Alegria</name>
	</author>
	<content type="html">The SQL fires only once (the pattern has no every) and the named window is a keepall, yes. That query does not return too many rows though.&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Sun, Dec 6, 2009 at 9:32 PM, Thomas Bernhardt &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26700986&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bernhardttom@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;&lt;div&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;
I&amp;#39;d recommend reading up on the performance tips in the section.&lt;br&gt;The named window is a keep-all policy and retains all events? You may want to retain only the last event per id.&lt;br&gt;The SQL query fires every 1 seconds and fills the named window?&lt;br&gt;
Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family:times new roman,new york,times,serif;font-size:12pt&quot;&gt;&lt;div class=&quot;im&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; António Alegria &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26700986&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&lt;b&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26700986&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Fri, December 4, 2009 6:43:56 AM&lt;br&gt;
&lt;b&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user]
 Real-time hierarchical aggregated statistics&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;/div&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;Well, with 10 &amp;quot;StockTick&amp;quot; events per second esper starts to fall behind in updating all the tree in real time. My interest here is in to know if there is a more intelligent way to approaching this problem or if this is as good as it gets.&lt;br&gt;

&lt;br&gt;Thanks,&lt;br&gt;&lt;br&gt;António Alegria&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Dec 3, 2009 at 9:27 PM, Alexandre Vasseur &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26700986&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avasseur@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex&quot;&gt;
What do you mean exactly with &amp;quot;isn&amp;#39;t scalable&amp;quot; and &amp;quot;ineficient&amp;quot; ?&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/3 António Alegria &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26700986&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;div&gt;

&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex&quot;&gt;Hi, we have the following problem we are trying to solve with Esper. We have, in fact, reached a solution but it isn&amp;#39;t scalable. The problem has nothing to do with the stockmarket but I will present it as such.&lt;div&gt;



&lt;br&gt;&lt;/div&gt;&lt;div&gt;Suppose Esper receives several StockTick events, with the following fields:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;StockTick:&lt;/div&gt;&lt;div&gt;* symbol: string (e.g. &amp;quot;MSFT&amp;quot;, &amp;quot;APPL&amp;quot;, &amp;quot;GOOG&amp;quot;, ...)&lt;/div&gt;





&lt;div&gt;* price: float&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Furthermore, each StockTick symbol can be associated with grouping hierarchy, such as business field, city, region, country, continent. This grouping information is collected from an SQL query and put in a named window with the following fields:&lt;/div&gt;





&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;GroupTree:&lt;/div&gt;&lt;div&gt;* group: string&lt;/div&gt;&lt;div&gt;* member: string&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example events in this named windows are: [&amp;quot;USA&amp;quot;, &amp;quot;Washington&amp;quot;], [&amp;quot;Washington&amp;quot;, &amp;quot;Redmond&amp;quot;], [&amp;quot;IT&amp;quot;, &amp;quot;MSFT&amp;quot;].&lt;/div&gt;





&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;We want to develop EPL rules that, in real-time and for each arriving StockTick, calculate the average price for each category in this grouping hierarchy (e.g. average for each country, each region, etc...).&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;You can see our current (ineficient solution) in &lt;a rel=&quot;nofollow&quot; href=&quot;https://gist.github.com/f1bec8803ee7de907570&quot; target=&quot;_blank&quot;&gt;https://gist.github.com/f1bec8803ee7de907570&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I would greatly appreciate it if someone could tell me the &amp;quot;right way&amp;quot; to do this.&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;div&gt;António Alegria&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/div&gt;&lt;br&gt;

      &lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Real-time-hierarchical-aggregated-statistics-tp26631575p26700986.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26698371</id>
	<title>Re: Retrieving events prior an event</title>
	<published>2009-12-08T10:24:58Z</published>
	<updated>2009-12-08T10:24:58Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;Hi Cedrik,&lt;br&gt;&lt;br&gt;here is a possible match-recognize (the regular expression only):&lt;br&gt;- A3 B1:&amp;nbsp; (A X X X X B), select A and B&lt;br&gt;- A12 B1:&amp;nbsp; (B X X X X A), select A and B&amp;nbsp; &lt;br&gt;&lt;br&gt;or both at the same time &quot;(A X X X X B) | (B X X X X A)&quot;&lt;br&gt;
&lt;br&gt;Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: times new roman,new york,times,serif; font-size: 12pt;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; Cédric Moonen &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26698371&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26698371&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Tue, December 8, 2009 9:07:18 AM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] Retrieving events prior an event&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;off&quot;&gt;

Thanks for the reply,&lt;br&gt;&lt;br&gt;
But I don't think this will really solve my problem. Let me show you with
an example, which will probably be clearer than my explanation. Suppose
the following sequence of events:&lt;br&gt;
A1 A2 A3 A4 A5 A6 A7 B1 A8 A9 A10 A11 A12 A13 A14 A15 A16 B2 A17
A18&lt;br&gt;&lt;br&gt;
What I want to retrieve is:&lt;br&gt;
- A3 B1 (A3 being the fifth A event before B10)&lt;br&gt;
- A12 B1&lt;br&gt;&lt;br&gt;
I don't think this is really feasible using a pattern, is it ?&amp;nbsp;
&lt;br&gt;&lt;br&gt;
At 14:51 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=&quot;cite&quot; class=&quot;cite&quot; cite=&quot;&quot;&gt;May be a pattern using repeat or
repeat until would be a better way?&lt;br&gt;&lt;br&gt;
2009/12/8 Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26698371&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;
&amp;gt;&lt;br&gt;

&lt;dl&gt;
&lt;dd&gt;Hello,&lt;br&gt;&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;I'm a bit stuck with a problem when trying to retrieve events that
happened before a specific event. My scenario is that I have events
coming in and all those events have the same base event (let's call it
BaseEvent). Then, there are some specific events that I am looking for
(SpecificEvent). I need to retrieve all those specific events with the
base event that occured 5th-prior that specific event.&lt;br&gt;&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;The first thing I did was something like this:&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;select * from SpecificEvent as event unidirectional,
BaseEvent.win:length(5).std:firstevent() as prevEvent&lt;br&gt;&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;But this didn't work as I expected and looking at the documentation
of the std:firstevent, it is explained there that I should use the prev
function instead because the window is restarted each time. So, I tried
then to use the prev function but there's no explanation in the doc on
how I have to specify that I want the full event and not one of the
properties (although, it is stated that it should be possible). I tried
to write something like this:&lt;br&gt;&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;select event, prev(5, *) as prevEvent from SpecificEvent as event
unidirectional, BaseEvent.win:length(5)&lt;br&gt;&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;But it complains about the syntax error for the '*' symbol.&lt;br&gt;&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;So my questions are:&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;1) How to write suche a statement ?&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;2) If there are multiple streams, how will the prev function
&quot;know&quot; for which stream it has to select the event ?&lt;br&gt;&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;I'm a bit confused with this prev function.&lt;br&gt;&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;Thanks for your feedback.&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;Cédric&lt;br&gt;&lt;br&gt;
&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;
---------------------------------------------------------------------&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;To unsubscribe from this list, please visit:&lt;br&gt;&lt;br&gt;

&lt;/dd&gt;&lt;dd&gt;&lt;span&gt;&amp;nbsp;
&lt;a target=&quot;_blank&quot; href=&quot;http://xircles.codehaus.org/manage_email&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;
&lt;br&gt;

&lt;/dd&gt;&lt;/dl&gt;&lt;/blockquote&gt;
&lt;p&gt; 
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
 &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26698371&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt; &amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;br&gt;&lt;br&gt;
&lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;http://www.fmtc.be/&quot;&gt;www.fmtc.be&lt;br&gt;
&lt;/a&gt;&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;on&quot;&gt;&lt;/p&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg19.c1.mail.mud.yahoo.com compressed/chunked Tue Dec  8 10:13:34 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Retrieving-events-prior-an-event-tp26691705p26698371.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26698067</id>
	<title>match_recognize clause with aggregations</title>
	<published>2009-12-08T10:06:57Z</published>
	<updated>2009-12-08T10:06:57Z</updated>
	<author>
		<name>Sandeep Poreddy</name>
	</author>
	<content type="html">&lt;html xmlns:v=&quot;urn:schemas-microsoft-com:vml&quot; xmlns:o=&quot;urn:schemas-microsoft-com:office:office&quot; xmlns:w=&quot;urn:schemas-microsoft-com:office:word&quot; xmlns:m=&quot;http://schemas.microsoft.com/office/2004/12/omml&quot; xmlns=&quot;http://www.w3.org/TR/REC-html40&quot;&gt;

&lt;head&gt;
&lt;meta http-equiv=Content-Type content=&quot;text/html; charset=us-ascii&quot;&gt;
&lt;meta name=Generator content=&quot;Microsoft Word 12 (filtered medium)&quot;&gt;

&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:shapedefaults v:ext=&quot;edit&quot; spidmax=&quot;1026&quot; /&gt;
&lt;/xml&gt;&lt;![endif]--&gt;&lt;!--[if gte mso 9]&gt;&lt;xml&gt;
 &lt;o:shapelayout v:ext=&quot;edit&quot;&gt;
  &lt;o:idmap v:ext=&quot;edit&quot; data=&quot;1&quot; /&gt;
 &lt;/o:shapelayout&gt;&lt;/xml&gt;&lt;![endif]--&gt;
&lt;/head&gt;

&lt;body lang=EN-US link=blue vlink=purple&gt;

&lt;div class=Section1&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;Hello, &lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;Need some help with match_recognize clause. &amp;nbsp;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;Consider the following EPL:&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:black'&gt;stmt2 = &lt;/span&gt;&lt;span style='font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;SELECT&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;id,&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;outsideTemp,&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;timestamp1,tempString&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;FROM&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;OutputEventsOne&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp;match_recognize( &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; measures &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;A.id&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;as&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;id,&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;A.outsideTemp&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;as&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;outsideTemp,&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
A.timestamp1 &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#2A00FF'&gt;as&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#2A00FF'&gt;a_timestamp1,&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:
&quot;Courier New&quot;;color:#2A00FF'&gt;sum(B.timestamp1&lt;/span&gt;&lt;span style='font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;-&lt;/span&gt;&lt;span style='font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:
10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;A.timestamp1)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;as&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;timestamp1,&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;A.tempString&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;as&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;tempString&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; all &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;matches&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; after &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;match&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;skip&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;to&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;current&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;row&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pattern &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;(&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;A&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;B+)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; define &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;A &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;as&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;(A.tempString&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; = &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;'LESS'&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;),&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:black'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; B &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;as&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;(&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;B.tempString&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; = &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;'LESS')&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;AND&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt;&amp;nbsp; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;sum(B.timestamp1&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;-&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;A.timestamp1)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black'&gt; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF'&gt;&amp;gt;3000);&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#2A00FF'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#2A00FF'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#2A00FF'&gt;The statement gets registered with the esper engine without any
problem. But an exception is thrown when I run the application. I see that no
exception is thrown when I remove the aggregate &amp;#8216;sum&amp;#8217; from the
statement. &lt;/span&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;Is it not legal to use aggregations in the define part of match
recognize clause?.&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#2A00FF'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#2A00FF'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:#2A00FF'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;SEVERE: ##&lt;/span&gt;&lt;span style='font-size:
10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:navy'&gt;com.espertech.esper.client.EPException&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;Caused by: &lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;java.lang.NullPointerException&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.epl.expression.ExprAggregateNode.evaluate(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;ExprAggregateNode.java:136&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.epl.expression.ExprRelationalOpNode.evaluate(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;ExprRelationalOpNode.java:92&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.epl.expression.ExprAndNode.evaluate(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;ExprAndNode.java:58&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.rowregex.RegexNFAStateOneToMany.matches(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;RegexNFAStateOneToMany.java:36&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.rowregex.EventRowRegexNFAView.step(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;EventRowRegexNFAView.java:792&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.rowregex.EventRowRegexNFAView.update(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;EventRowRegexNFAView.java:305&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.view.ZeroDepthStream.insert(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;ZeroDepthStream.java:70&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.view.stream.StreamFactorySvcImpl$2.matchFound(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;StreamFactorySvcImpl.java:166&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.core.EPRuntimeImpl.processStatementFilterSingle(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;EPRuntimeImpl.java:1031&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.core.EPRuntimeImpl.processMatches(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;EPRuntimeImpl.java:824&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal style='text-autospace:none'&gt;&lt;span style='font-size:10.0pt;
font-family:&quot;Courier New&quot;;color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at
com.espertech.esper.core.EPRuntimeImpl.processWrappedEvent(&lt;/span&gt;&lt;u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:navy'&gt;EPRuntimeImpl.java:398&lt;/span&gt;&lt;/u&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;color:red'&gt;)&lt;/span&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:10.0pt;font-family:&quot;Courier New&quot;;
color:red'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... 11 more&lt;/span&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;color:#1F497D'&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;Thanks,&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;;
color:#1F497D'&gt;Sandeep&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p class=MsoNormal&gt;&lt;span style='font-size:11.0pt;font-family:&quot;Calibri&quot;,&quot;sans-serif&quot;'&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/span&gt;&lt;/p&gt;

&lt;/div&gt;

&lt;/body&gt;

&lt;/html&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/match_recognize-clause-with-aggregations-tp26698067p26698067.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26694409</id>
	<title>Re: Retrieving events prior an event</title>
	<published>2009-12-08T06:07:18Z</published>
	<updated>2009-12-08T06:07:18Z</updated>
	<author>
		<name>Cédric Moonen</name>
	</author>
	<content type="html">&lt;html&gt;
&lt;body&gt;
Thanks for the reply,&lt;br&gt;&lt;br&gt;
But I don't think this will really solve my problem. Let me show you with
an example, which will probably be clearer than my explanation. Suppose
the following sequence of events:&lt;br&gt;
A1 A2 A3 A4 A5 A6 A7 B1 A8 A9 A10 A11 A12 A13 A14 A15 A16 B2 A17
A18&lt;br&gt;&lt;br&gt;
What I want to retrieve is:&lt;br&gt;
- A3 B1 (A3 being the fifth A event before B10)&lt;br&gt;
- A12 B1&lt;br&gt;&lt;br&gt;
I don't think this is really feasible using a pattern, is it ?&amp;nbsp;
&lt;br&gt;&lt;br&gt;
At 14:51 8/12/2009, you wrote:&lt;br&gt;
&lt;blockquote type=cite class=cite cite=&quot;&quot;&gt;May be a pattern using repeat or
repeat until would be a better way?&lt;br&gt;&lt;br&gt;
2009/12/8 Cédric Moonen
&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26694409&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;
&amp;gt;&lt;br&gt;

&lt;dl&gt;
&lt;dd&gt;Hello,&lt;br&gt;&lt;br&gt;

&lt;dd&gt;I'm a bit stuck with a problem when trying to retrieve events that
happened before a specific event. My scenario is that I have events
coming in and all those events have the same base event (let's call it
BaseEvent). Then, there are some specific events that I am looking for
(SpecificEvent). I need to retrieve all those specific events with the
base event that occured 5th-prior that specific event.&lt;br&gt;&lt;br&gt;

&lt;dd&gt;The first thing I did was something like this:&lt;br&gt;

&lt;dd&gt;select * from SpecificEvent as event unidirectional,
BaseEvent.win:length(5).std:firstevent() as prevEvent&lt;br&gt;&lt;br&gt;

&lt;dd&gt;But this didn't work as I expected and looking at the documentation
of the std:firstevent, it is explained there that I should use the prev
function instead because the window is restarted each time. So, I tried
then to use the prev function but there's no explanation in the doc on
how I have to specify that I want the full event and not one of the
properties (although, it is stated that it should be possible). I tried
to write something like this:&lt;br&gt;&lt;br&gt;

&lt;dd&gt;select event, prev(5, *) as prevEvent from SpecificEvent as event
unidirectional, BaseEvent.win:length(5)&lt;br&gt;&lt;br&gt;

&lt;dd&gt;But it complains about the syntax error for the '*' symbol.&lt;br&gt;&lt;br&gt;

&lt;dd&gt;So my questions are:&lt;br&gt;

&lt;dd&gt;1) How to write suche a statement ?&lt;br&gt;

&lt;dd&gt;2) If there are multiple streams, how will the prev function
&amp;quot;know&amp;quot; for which stream it has to select the event ?&lt;br&gt;&lt;br&gt;

&lt;dd&gt;I'm a bit confused with this prev function.&lt;br&gt;&lt;br&gt;

&lt;dd&gt;Thanks for your feedback.&lt;br&gt;

&lt;dd&gt;Cédric&lt;br&gt;&lt;br&gt;
&lt;br&gt;

&lt;dd&gt;
---------------------------------------------------------------------&lt;br&gt;

&lt;dd&gt;To unsubscribe from this list, please visit:&lt;br&gt;&lt;br&gt;

&lt;dd&gt;&amp;nbsp;
&lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;
http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;
&lt;br&gt;

&lt;/dl&gt;&lt;/blockquote&gt;
&lt;x-sigsep&gt;&lt;p&gt;&lt;/x-sigsep&gt;
Cédric Moonen&lt;br&gt;
Projectingenieur&lt;br&gt;
&lt;x-tab&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;br&gt;
Flanders' MECHATRONICS Technology Centre (FMTC)&lt;br&gt;
Celestijnenlaan 300D&lt;br&gt;
B-3001 Leuven&lt;br&gt;
Belgium&lt;br&gt;&lt;br&gt;
GSM: +32-498-91.94.14&lt;br&gt;
Fax: +32-16-32.80.64&lt;br&gt;
&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26694409&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&lt;x-tab&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;x-tab&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/x-tab&gt;&lt;br&gt;&lt;br&gt;
&lt;a href=&quot;http://www.fmtc.be/&quot; eudora=&quot;autourl&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;www.fmtc.be&lt;br&gt;
&lt;/a&gt;&lt;/body&gt;
&lt;/html&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Retrieving-events-prior-an-event-tp26691705p26694409.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26694159</id>
	<title>Re: Retrieving events prior an event</title>
	<published>2009-12-08T05:51:07Z</published>
	<updated>2009-12-08T05:51:07Z</updated>
	<author>
		<name>Alexandre Vasseur</name>
	</author>
	<content type="html">May be a pattern using repeat or repeat until would be a better way?&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/8 Cédric Moonen &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26694159&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;cedric.moonen@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hello,&lt;br&gt;
&lt;br&gt;
I&amp;#39;m a bit stuck with a problem when trying to retrieve events that happened before a specific event. My scenario is that I have events coming in and all those events have the same base event (let&amp;#39;s call it BaseEvent). Then, there are some specific events that I am looking for (SpecificEvent). I need to retrieve all those specific events with the base event that occured 5th-prior that specific event.&lt;br&gt;

&lt;br&gt;
The first thing I did was something like this:&lt;br&gt;
select * from SpecificEvent as event unidirectional, BaseEvent.win:length(5).std:firstevent() as prevEvent&lt;br&gt;
&lt;br&gt;
But this didn&amp;#39;t work as I expected and looking at the documentation of the std:firstevent, it is explained there that I should use the prev function instead because the window is restarted each time. So, I tried then to use the prev function but there&amp;#39;s no explanation in the doc on how I have to specify that I want the full event and not one of the properties (although, it is stated that it should be possible). I tried to write something like this:&lt;br&gt;

&lt;br&gt;
select event, prev(5, *) as prevEvent from SpecificEvent as event unidirectional, BaseEvent.win:length(5)&lt;br&gt;
&lt;br&gt;
But it complains about the syntax error for the &amp;#39;*&amp;#39; symbol.&lt;br&gt;
&lt;br&gt;
So my questions are:&lt;br&gt;
1) How to write suche a statement ?&lt;br&gt;
2) If there are multiple streams, how will the prev function &amp;quot;know&amp;quot; for which stream it has to select the event ?&lt;br&gt;
&lt;br&gt;
I&amp;#39;m a bit confused with this prev function.&lt;br&gt;
&lt;br&gt;
Thanks for your feedback.&lt;br&gt;
Cédric&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
---------------------------------------------------------------------&lt;br&gt;
To unsubscribe from this list, please visit:&lt;br&gt;
&lt;br&gt;
   &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Retrieving-events-prior-an-event-tp26691705p26694159.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26691705</id>
	<title>Retrieving events prior an event</title>
	<published>2009-12-08T02:26:49Z</published>
	<updated>2009-12-08T02:26:49Z</updated>
	<author>
		<name>Cédric Moonen</name>
	</author>
	<content type="html">Hello,
&lt;br&gt;&lt;br&gt;I'm a bit stuck with a problem when trying to 
&lt;br&gt;retrieve events that happened before a specific 
&lt;br&gt;event. My scenario is that I have events coming 
&lt;br&gt;in and all those events have the same base event 
&lt;br&gt;(let's call it BaseEvent). Then, there are some 
&lt;br&gt;specific events that I am looking for 
&lt;br&gt;(SpecificEvent). I need to retrieve all those 
&lt;br&gt;specific events with the base event that occured 5th-prior that specific event.
&lt;br&gt;&lt;br&gt;The first thing I did was something like this:
&lt;br&gt;select * from SpecificEvent as event 
&lt;br&gt;unidirectional, BaseEvent.win:length(5).std:firstevent() as prevEvent
&lt;br&gt;&lt;br&gt;But this didn't work as I expected and looking at 
&lt;br&gt;the documentation of the std:firstevent, it is 
&lt;br&gt;explained there that I should use the prev 
&lt;br&gt;function instead because the window is restarted 
&lt;br&gt;each time. So, I tried then to use the prev 
&lt;br&gt;function but there's no explanation in the doc on 
&lt;br&gt;how I have to specify that I want the full event 
&lt;br&gt;and not one of the properties (although, it is 
&lt;br&gt;stated that it should be possible). I tried to write something like this:
&lt;br&gt;&lt;br&gt;select event, prev(5, *) as prevEvent from 
&lt;br&gt;SpecificEvent as event unidirectional, BaseEvent.win:length(5)
&lt;br&gt;&lt;br&gt;But it complains about the syntax error for the '*' symbol.
&lt;br&gt;&lt;br&gt;So my questions are:
&lt;br&gt;1) How to write suche a statement ?
&lt;br&gt;2) If there are multiple streams, how will the 
&lt;br&gt;prev function &amp;quot;know&amp;quot; for which stream it has to select the event ?
&lt;br&gt;&lt;br&gt;I'm a bit confused with this prev function.
&lt;br&gt;&lt;br&gt;Thanks for your feedback.
&lt;br&gt;Cédric
&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Retrieving-events-prior-an-event-tp26691705p26691705.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26677520</id>
	<title>Re: ESPER-424</title>
	<published>2009-12-07T05:50:18Z</published>
	<updated>2009-12-07T05:50:18Z</updated>
	<author>
		<name>Theo Schlossnagle</name>
	</author>
	<content type="html">&lt;br&gt;On Dec 7, 2009, at 8:37 AM, Theo Schlossnagle wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; On Dec 5, 2009, at 10:09 AM, Thomas Bernhardt wrote:
&lt;br&gt;&amp;gt;&amp;gt; Hi Theo,
&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; thank you for providing the test case, I have been able to reproduce, the JIRA is &lt;a href=&quot;http://jira.codehaus.org/browse/ESPER-424&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/ESPER-424&lt;/a&gt;&lt;br&gt;&amp;gt;&amp;gt; 
&lt;br&gt;&amp;gt;&amp;gt; Best regards
&lt;br&gt;&amp;gt;&amp;gt; Tom
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Tom,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; I see this ticket is listed as a &amp;quot;minor&amp;quot; priority ticket. &amp;nbsp;Is there anything I can do to help this ticket along to resolution? It's causing us all sorts of problems (we're using the sort with a limit 1 clause to the &amp;quot;right&amp;quot; answer, only it isn't right). &amp;nbsp;Equally useful would be a work-around? &amp;nbsp;I'd be grateful for any help offered.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Thanks!
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Theo
&lt;/div&gt;&lt;br&gt;&lt;br&gt;I just saw your post in the ticket as to a work around and my brief testing indicates that it works. &amp;nbsp;Thanks!
&lt;br&gt;&lt;br&gt;Best regards,
&lt;br&gt;&lt;br&gt;Theo
&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/order-by-not-working-in-single-input-event-causing-multiple-events-%28ESPER-409-didn%27t-fix%29-tp26549770p26677520.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26677409</id>
	<title>Re: ESPER-424</title>
	<published>2009-12-07T05:42:45Z</published>
	<updated>2009-12-07T05:42:45Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;The workaround had been added to the JIRA. &lt;br&gt;&lt;br&gt;Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 13px;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; Theo Schlossnagle &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26677409&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jesus@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26677409&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Cc:&lt;/span&gt;&lt;/b&gt; Theo Schlossnagle &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26677409&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jesus@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Mon, December 7, 2009 8:37:07 AM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; [esper-user] ESPER-424&lt;br&gt;&lt;/font&gt;&lt;br&gt;
On Dec 5, 2009, at 10:09 AM, Thomas Bernhardt wrote:&lt;br&gt;&amp;gt; Hi Theo,&lt;br&gt;&amp;gt; &lt;br&gt;&lt;span&gt;&amp;gt; thank you for providing the test case, I have been able to reproduce, the JIRA is &lt;a target=&quot;_blank&quot; href=&quot;http://jira.codehaus.org/browse/ESPER-424&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/ESPER-424&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Best regards&lt;br&gt;&amp;gt; Tom&lt;br&gt;&lt;br&gt;Tom,&lt;br&gt;&lt;br&gt;I see this ticket is listed as a &quot;minor&quot; priority ticket.&amp;nbsp; Is there anything I can do to help this ticket along to resolution? It's causing us all sorts of problems (we're using the sort with a limit 1 clause to the &quot;right&quot; answer, only it isn't right).&amp;nbsp; Equally useful would be a work-around?&amp;nbsp; I'd be grateful for any help offered.&lt;br&gt;&lt;br&gt;Thanks!&lt;br&gt;&lt;br&gt;Theo&lt;br&gt;&lt;br&gt;--&lt;br&gt;Theo Schlossnagle&lt;br&gt;&lt;span&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://omniti.com/is/theo-schlossnagle&quot; rel=&quot;nofollow&quot;&gt;http://omniti.com/is/theo-schlossnagle&lt;/a&gt;&lt;/span&gt;&lt;br&gt;p: +1.443.325.1357 x201&amp;nbsp;  f:
 +1.410.872.4911&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------&lt;br&gt;To unsubscribe from this list, please visit:&lt;br&gt;&lt;br&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://xircles.codehaus.org/manage_email&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg18.c1.mail.mud.yahoo.com compressed/chunked Sun Dec  6 19:20:59 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/order-by-not-working-in-single-input-event-causing-multiple-events-%28ESPER-409-didn%27t-fix%29-tp26549770p26677409.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26677353</id>
	<title>ESPER-424</title>
	<published>2009-12-07T05:37:07Z</published>
	<updated>2009-12-07T05:37:07Z</updated>
	<author>
		<name>Theo Schlossnagle</name>
	</author>
	<content type="html">On Dec 5, 2009, at 10:09 AM, Thomas Bernhardt wrote:
&lt;br&gt;&amp;gt; Hi Theo,
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; thank you for providing the test case, I have been able to reproduce, the JIRA is &lt;a href=&quot;http://jira.codehaus.org/browse/ESPER-424&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/ESPER-424&lt;/a&gt;&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Best regards
&lt;br&gt;&amp;gt; Tom
&lt;br&gt;&lt;br&gt;Tom,
&lt;br&gt;&lt;br&gt;I see this ticket is listed as a &amp;quot;minor&amp;quot; priority ticket. &amp;nbsp;Is there anything I can do to help this ticket along to resolution? It's causing us all sorts of problems (we're using the sort with a limit 1 clause to the &amp;quot;right&amp;quot; answer, only it isn't right). &amp;nbsp;Equally useful would be a work-around? &amp;nbsp;I'd be grateful for any help offered.
&lt;br&gt;&lt;br&gt;Thanks!
&lt;br&gt;&lt;br&gt;Theo
&lt;br&gt;&lt;br&gt;--
&lt;br&gt;Theo Schlossnagle
&lt;br&gt;&lt;a href=&quot;http://omniti.com/is/theo-schlossnagle&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://omniti.com/is/theo-schlossnagle&lt;/a&gt;&lt;br&gt;p: +1.443.325.1357 x201 &amp;nbsp; f: +1.410.872.4911
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/order-by-not-working-in-single-input-event-causing-multiple-events-%28ESPER-409-didn%27t-fix%29-tp26549770p26677353.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26669301</id>
	<title>Re: Real-time hierarchical aggregated statistics</title>
	<published>2009-12-06T13:32:47Z</published>
	<updated>2009-12-06T13:32:47Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;I'd recommend reading up on the performance tips in the section.&lt;br&gt;The named window is a keep-all policy and retains all events? You may want to retain only the last event per id.&lt;br&gt;The SQL query fires every 1 seconds and fills the named window?&lt;br&gt;Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: times new roman,new york,times,serif; font-size: 12pt;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; António Alegria &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26669301&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26669301&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Fri, December 4, 2009 6:43:56 AM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user]
 Real-time hierarchical aggregated statistics&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;off&quot;&gt;Well, with 10 &quot;StockTick&quot; events per second esper starts to fall behind in updating all the tree in real time. My interest here is in to know if there is a more intelligent way to approaching this problem or if this is as good as it gets.&lt;br&gt;
&lt;br&gt;Thanks,&lt;br&gt;&lt;br&gt;António Alegria&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Dec 3, 2009 at 9:27 PM, Alexandre Vasseur &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26669301&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avasseur@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
What do you mean exactly with &quot;isn't scalable&quot; and &quot;ineficient&quot; ?&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/3 António Alegria &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26669301&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hi, we have the following problem we are trying to solve with Esper. We have, in fact, reached a solution but it isn't scalable. The problem has nothing to do with the stockmarket but I will present it as such.&lt;div&gt;


&lt;br&gt;&lt;/div&gt;&lt;div&gt;Suppose Esper receives several StockTick events, with the following fields:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;StockTick:&lt;/div&gt;&lt;div&gt;* symbol: string (e.g. &quot;MSFT&quot;, &quot;APPL&quot;, &quot;GOOG&quot;, ...)&lt;/div&gt;




&lt;div&gt;* price: float&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Furthermore, each StockTick symbol can be associated with grouping hierarchy, such as business field, city, region, country, continent. This grouping information is collected from an SQL query and put in a named window with the following fields:&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;GroupTree:&lt;/div&gt;&lt;div&gt;* group: string&lt;/div&gt;&lt;div&gt;* member: string&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example events in this named windows are: [&quot;USA&quot;, &quot;Washington&quot;], [&quot;Washington&quot;, &quot;Redmond&quot;], [&quot;IT&quot;, &quot;MSFT&quot;].&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;We want to develop EPL rules that, in real-time and for each arriving StockTick, calculate the average price for each category in this grouping hierarchy (e.g. average for each country, each region, etc...).&lt;/div&gt;



&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;You can see our current (ineficient solution) in &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://gist.github.com/f1bec8803ee7de907570&quot;&gt;https://gist.github.com/f1bec8803ee7de907570&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I would greatly appreciate it if someone could tell me the &quot;right way&quot; to do this.&lt;/div&gt;



&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;div&gt;António Alegria&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;on&quot;&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg21.c1.mail.mud.yahoo.com compressed/chunked Sun Dec  6 05:56:41 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Real-time-hierarchical-aggregated-statistics-tp26631575p26669301.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26656432</id>
	<title>Re: order by not working in single input event causing multiple events (ESPER-409 didn't fix)</title>
	<published>2009-12-05T07:09:39Z</published>
	<updated>2009-12-05T07:09:39Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;Hi Theo,&lt;br&gt;&lt;br&gt;&lt;span&gt;thank you for providing the test case, I have been able to reproduce, the JIRA is &lt;a target=&quot;_blank&quot; href=&quot;http://jira.codehaus.org/browse/ESPER-424&quot; rel=&quot;nofollow&quot;&gt;http://jira.codehaus.org/browse/ESPER-424&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;Best regards&lt;br&gt;Tom&lt;br&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 13px;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; Theo Schlossnagle &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26656432&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;jesus@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26656432&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Fri, December 4, 2009 8:46:12 AM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] order by not working in single input
 event causing multiple events (ESPER-409 didn't fix)&lt;br&gt;&lt;/font&gt;&lt;br&gt;
I haven't heard back from anyone about this.&amp;nbsp; Is there something that can be done with the repeatable test cases I provided?&amp;nbsp; They just plop right into the esper unit test setup.&lt;br&gt;&lt;br&gt;Best regards,&lt;br&gt;&lt;br&gt;Theo&lt;br&gt;&lt;br&gt;On Dec 1, 2009, at 11:23 AM, Theo Schlossnagle wrote:&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Okay... this looks very odd.&amp;nbsp; The breaking case is not what I thought it was...&amp;nbsp; I've attached a test case and a new SupportHierarchyEvent class to help it.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; This works:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; select c1.event_criteria_id as ecid,&lt;br&gt;&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  c2.priority as prio, cast(count(*), int) as cnt&lt;br&gt;&amp;gt; from SupportHierarchyEvent..std:lastevent() as c1,&lt;br&gt;&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  SupportHierarchyEvent.std:groupby(event_criteria_id).std:lastevent() as c2,&lt;br&gt;&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  SupportHierarchyEvent.std:groupby(event_criteria_id).std:lastevent() as p&lt;br&gt;&amp;gt; where c2.event_criteria_id in
 (c1.event_criteria_id,2,1)&lt;br&gt;&amp;gt;&amp;nbsp; &amp;nbsp;  and p.event_criteria_id in (c1.parent_event_criteria_id, c1.event_criteria_id)&lt;br&gt;&amp;gt; order by c2.priority asc&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; This does not:&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; select c1.event_criteria_id as ecid,&lt;br&gt;&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  c1.priority as priority,&lt;br&gt;&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  c2.priority as prio, cast(count(*), int) as cnt&lt;br&gt;&amp;gt; from SupportHierarchyEvent..std:lastevent() as c1,&lt;br&gt;&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  SupportHierarchyEvent.std:groupby(event_criteria_id).std:lastevent() as c2,&lt;br&gt;&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;  SupportHierarchyEvent.std:groupby(event_criteria_id).std:lastevent() as p&lt;br&gt;&amp;gt; where c2.event_criteria_id in (c1.event_criteria_id,2,1)&lt;br&gt;&amp;gt;&amp;nbsp; &amp;nbsp;  and p.event_criteria_id in (c1.parent_event_criteria_id, c1.event_criteria_id)&lt;br&gt;&amp;gt; order by c2.priority asc&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; Note the only difference between them is that the
 second additionally selects out c1.priority which somehow breaks the order by.&amp;nbsp; The test case has a for(1 .. 1000) to trigger the error.&amp;nbsp; If I loop only once I get roughly a 50% failure rate.&lt;br&gt;&amp;gt; &lt;br&gt;&amp;gt; --&lt;br&gt;&amp;gt; Theo Schlossnagle&lt;/div&gt;&lt;span&gt;&amp;gt; &lt;a target=&quot;_blank&quot; href=&quot;http://omniti.com/is/theo-schlossnagle&quot; rel=&quot;nofollow&quot;&gt;http://omniti.com/is/theo-schlossnagle&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;--&lt;br&gt;Theo Schlossnagle&lt;br&gt;&lt;a href=&quot;http://omniti.com/is/theo-schlossnagle&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://omniti.com/is/theo-schlossnagle&lt;/a&gt;&lt;br&gt;p: +1.443.325.1357 x201&amp;nbsp;  f: +1.410.872.4911&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------&lt;br&gt;To unsubscribe from this list, please visit:&lt;br&gt;&lt;br&gt;&lt;span&gt;&amp;nbsp; &amp;nbsp; &lt;a target=&quot;_blank&quot; href=&quot;http://xircles.codehaus.org/manage_email&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg7.c1.mail.mud.yahoo.com compressed/chunked Fri Dec  4 12:43:15 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/order-by-not-working-in-single-input-event-causing-multiple-events-%28ESPER-409-didn%27t-fix%29-tp26549770p26656432.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26650430</id>
	<title>Re: Searching for a better way</title>
	<published>2009-12-04T14:41:59Z</published>
	<updated>2009-12-04T14:41:59Z</updated>
	<author>
		<name>Nicolas Dufour-4</name>
	</author>
	<content type="html">Yup thank you.&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;The repeat once well set is perfect for that.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Nicolas Dufour&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26650430&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nrdufour@...&lt;/a&gt;&lt;br&gt;&lt;br&gt;--&lt;br&gt;“Investment in knowledge pays the best interest.”&lt;br&gt;
                               —Benjamin Franklin&lt;br&gt;
&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Fri, Dec 4, 2009 at 6:00 AM, Thomas Bernhardt &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26650430&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bernhardttom@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;&quot;&gt;
&lt;div&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;Patterns deliver composite events, i.e. &amp;quot;a=A -&amp;gt; b=B&amp;quot; delivers A and B as a property to the complex output event, including arrays if using the pattern repeat operator.&lt;br&gt;
Match recognize also delivers array and composite/complex output events.&lt;br&gt;-Tom&lt;br&gt;&lt;div style=&quot;font-family:times new roman,new york,times,serif;font-size:12pt&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; Alexandre Vasseur &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26650430&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avasseur@...&lt;/a&gt;&amp;gt;&lt;div class=&quot;im&quot;&gt;
&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26650430&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;/div&gt;&lt;b&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Fri, December 4, 2009 4:02:20 AM&lt;br&gt;
&lt;b&gt;&lt;span style=&quot;font-weight:bold&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] Searching for a better
 way&lt;br&gt;&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
Hi&lt;br&gt;Have a look at&lt;br&gt;&lt;span&gt;&lt;a href=&quot;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl-views.html#view-win-length-batch&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl-views.html#view-win-length-batch&lt;/a&gt;&lt;/span&gt;&lt;br&gt;
&lt;span&gt;
&lt;a href=&quot;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/processingmodel.html#processingmodel_batch&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/processingmodel.html#processingmodel_batch&lt;/a&gt;&lt;/span&gt;&lt;br&gt;
&lt;span&gt;
&lt;a href=&quot;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl_clauses.html#epl-output-rate&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl_clauses.html#epl-output-rate&lt;/a&gt;&lt;/span&gt;&lt;br&gt;

&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Dec 3, 2009 at 11:35 PM, Nicolas Dufour &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26650430&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nrdufour@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left:1px solid rgb(204, 204, 204);margin:0pt 0pt 0pt 0.8ex;padding-left:1ex&quot;&gt;
Hello&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m fairly new to Esper and building a new engine in order to associate events that share certain criteria into a new event.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m trying to see what is the best way to aggregate n events that have the same property into a listener.&lt;/div&gt;


&lt;div&gt;By aggregate here I mean the listener actually receives those n events as one array and not n calls of the update listener method.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;event1(p = foo, status = warning)&lt;/div&gt;


&lt;div&gt;event2(p = bar, status = warning)&lt;/div&gt;&lt;div&gt;event3(p = foo, status = warning)&lt;/div&gt;&lt;div&gt;event4(p = foo, status = down)  --&amp;gt; fires the listener with the newEvents array containing event1, event3 and event4&lt;/div&gt;&lt;div&gt;


&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you&lt;/div&gt;&lt;div&gt;&lt;br clear=&quot;all&quot;&gt;Nicolas Dufour&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26650430&amp;i=5&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nrdufour@...&lt;/a&gt;&lt;br&gt;&lt;br&gt;--&lt;br&gt;“Investment in knowledge pays the best interest.”&lt;br&gt;
                               —Benjamin Franklin&lt;br&gt;


&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/div&gt;&lt;br&gt;

      &lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Searching-for-a-better-way-tp26634520p26650430.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26650420</id>
	<title>Esper and Hibernate</title>
	<published>2009-12-04T14:41:13Z</published>
	<updated>2009-12-04T14:41:13Z</updated>
	<author>
		<name>Nicolas Dufour-4</name>
	</author>
	<content type="html">Hello&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I was wondering if esper could be connected to hibernate and cache those objects ?&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you&lt;/div&gt;&lt;div&gt;&lt;br clear=&quot;all&quot;&gt;Nicolas Dufour&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26650420&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nrdufour@...&lt;/a&gt;&lt;br&gt;
&lt;br&gt;--&lt;br&gt;“Investment in knowledge pays the best interest.”&lt;br&gt;                               —Benjamin Franklin&lt;br&gt;
&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Esper-and-Hibernate-tp26650420p26650420.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26642725</id>
	<title>Re: order by not working in single input event causing multiple events (ESPER-409 didn't fix)</title>
	<published>2009-12-04T05:46:12Z</published>
	<updated>2009-12-04T05:46:12Z</updated>
	<author>
		<name>Theo Schlossnagle</name>
	</author>
	<content type="html">I haven't heard back from anyone about this. &amp;nbsp;Is there something that can be done with the repeatable test cases I provided? &amp;nbsp;They just plop right into the esper unit test setup.
&lt;br&gt;&lt;br&gt;Best regards,
&lt;br&gt;&lt;br&gt;Theo
&lt;br&gt;&lt;br&gt;On Dec 1, 2009, at 11:23 AM, Theo Schlossnagle wrote:
&lt;br&gt;&lt;div class='shrinkable-quote'&gt;&lt;br&gt;&amp;gt; Okay... this looks very odd. &amp;nbsp;The breaking case is not what I thought it was... &amp;nbsp;I've attached a test case and a new SupportHierarchyEvent class to help it.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This works:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; select c1.event_criteria_id as ecid,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c2.priority as prio, cast(count(*), int) as cnt
&lt;br&gt;&amp;gt; from SupportHierarchyEvent..std:lastevent() as c1,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SupportHierarchyEvent.std:groupby(event_criteria_id).std:lastevent() as c2,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SupportHierarchyEvent.std:groupby(event_criteria_id).std:lastevent() as p
&lt;br&gt;&amp;gt; where c2.event_criteria_id in (c1.event_criteria_id,2,1)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; and p.event_criteria_id in (c1.parent_event_criteria_id, c1.event_criteria_id)
&lt;br&gt;&amp;gt; order by c2.priority asc
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; This does not:
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; select c1.event_criteria_id as ecid,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c1.priority as priority,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; c2.priority as prio, cast(count(*), int) as cnt
&lt;br&gt;&amp;gt; from SupportHierarchyEvent..std:lastevent() as c1,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SupportHierarchyEvent.std:groupby(event_criteria_id).std:lastevent() as c2,
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SupportHierarchyEvent.std:groupby(event_criteria_id).std:lastevent() as p
&lt;br&gt;&amp;gt; where c2.event_criteria_id in (c1.event_criteria_id,2,1)
&lt;br&gt;&amp;gt; &amp;nbsp; &amp;nbsp; and p.event_criteria_id in (c1.parent_event_criteria_id, c1.event_criteria_id)
&lt;br&gt;&amp;gt; order by c2.priority asc
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; Note the only difference between them is that the second additionally selects out c1.priority which somehow breaks the order by. &amp;nbsp;The test case has a for(1 .. 1000) to trigger the error. &amp;nbsp;If I loop only once I get roughly a 50% failure rate.
&lt;br&gt;&amp;gt; 
&lt;br&gt;&amp;gt; --
&lt;br&gt;&amp;gt; Theo Schlossnagle
&lt;br&gt;&amp;gt; &lt;a href=&quot;http://omniti.com/is/theo-schlossnagle&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://omniti.com/is/theo-schlossnagle&lt;/a&gt;&lt;/div&gt;&lt;br&gt;--
&lt;br&gt;Theo Schlossnagle
&lt;br&gt;&lt;a href=&quot;http://omniti.com/is/theo-schlossnagle&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://omniti.com/is/theo-schlossnagle&lt;/a&gt;&lt;br&gt;p: +1.443.325.1357 x201 &amp;nbsp; f: +1.410.872.4911
&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;---------------------------------------------------------------------
&lt;br&gt;To unsubscribe from this list, please visit:
&lt;br&gt;&lt;br&gt;&amp;nbsp; &amp;nbsp; &lt;a href=&quot;http://xircles.codehaus.org/manage_email&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://xircles.codehaus.org/manage_email&lt;/a&gt;&lt;br&gt;&lt;br&gt;&lt;br&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/order-by-not-working-in-single-input-event-causing-multiple-events-%28ESPER-409-didn%27t-fix%29-tp26549770p26642725.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26641944</id>
	<title>Re: Real-time hierarchical aggregated statistics</title>
	<published>2009-12-04T04:36:50Z</published>
	<updated>2009-12-04T04:36:50Z</updated>
	<author>
		<name>Alexandre Vasseur</name>
	</author>
	<content type="html">So what would be your acceptable minimal throughput?&lt;br&gt;And please also describe your hardware for reaching (CPU kind, CPU core and GHz, and also the heap size you &amp;#39;d allocate to the program).&lt;br&gt;Ideally please also share some actual test code so that we can work on reproducing this and see how your goal can be reached and if not, to explain why.&lt;br&gt;
&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/4 António Alegria &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641944&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Well, with 10 &amp;quot;StockTick&amp;quot; events per second esper starts to fall behind in updating all the tree in real time. My interest here is in to know if there is a more intelligent way to approaching this problem or if this is as good as it gets.&lt;br&gt;

&lt;br&gt;Thanks,&lt;br&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;br&gt;António Alegria&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Dec 3, 2009 at 9:27 PM, Alexandre Vasseur &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641944&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avasseur@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
What do you mean exactly with &amp;quot;isn&amp;#39;t scalable&amp;quot; and &amp;quot;ineficient&amp;quot; ?&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/3 António Alegria &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641944&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;div&gt;

&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hi, we have the following problem we are trying to solve with Esper. We have, in fact, reached a solution but it isn&amp;#39;t scalable. The problem has nothing to do with the stockmarket but I will present it as such.&lt;div&gt;



&lt;br&gt;&lt;/div&gt;&lt;div&gt;Suppose Esper receives several StockTick events, with the following fields:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;StockTick:&lt;/div&gt;&lt;div&gt;* symbol: string (e.g. &amp;quot;MSFT&amp;quot;, &amp;quot;APPL&amp;quot;, &amp;quot;GOOG&amp;quot;, ...)&lt;/div&gt;





&lt;div&gt;* price: float&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Furthermore, each StockTick symbol can be associated with grouping hierarchy, such as business field, city, region, country, continent. This grouping information is collected from an SQL query and put in a named window with the following fields:&lt;/div&gt;





&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;GroupTree:&lt;/div&gt;&lt;div&gt;* group: string&lt;/div&gt;&lt;div&gt;* member: string&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example events in this named windows are: [&amp;quot;USA&amp;quot;, &amp;quot;Washington&amp;quot;], [&amp;quot;Washington&amp;quot;, &amp;quot;Redmond&amp;quot;], [&amp;quot;IT&amp;quot;, &amp;quot;MSFT&amp;quot;].&lt;/div&gt;





&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;We want to develop EPL rules that, in real-time and for each arriving StockTick, calculate the average price for each category in this grouping hierarchy (e.g. average for each country, each region, etc...).&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;You can see our current (ineficient solution) in &lt;a href=&quot;https://gist.github.com/f1bec8803ee7de907570&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/f1bec8803ee7de907570&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I would greatly appreciate it if someone could tell me the &amp;quot;right way&amp;quot; to do this.&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;div&gt;António Alegria&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Real-time-hierarchical-aggregated-statistics-tp26631575p26641944.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26641869</id>
	<title>Re: Real-time hierarchical aggregated statistics</title>
	<published>2009-12-04T04:29:22Z</published>
	<updated>2009-12-04T04:29:22Z</updated>
	<author>
		<name>António Alegria</name>
	</author>
	<content type="html">Oh, sorry. I&amp;#39;m using both esper 3.1.0 and 3.2.0, JDK 1.6 and RedHat 5.3.&lt;br&gt;&lt;br&gt;Regards,&lt;br&gt;&lt;br&gt;AA&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Fri, Dec 4, 2009 at 11:56 AM, Thomas Bernhardt &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641869&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;bernhardttom@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;&lt;div&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;&lt;div&gt;And that is what version?&lt;br&gt;
&lt;/div&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;-Tom&lt;br&gt;&lt;div style=&quot;font-family: times new roman,new york,times,serif; font-size: 12pt;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; António Alegria &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641869&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;br&gt;
&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641869&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Fri, December 4, 2009 6:43:56 AM&lt;br&gt;
&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] Real-time hierarchical aggregated statistics&lt;br&gt;&lt;/font&gt;&lt;div&gt;&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
Well, with 10 &amp;quot;StockTick&amp;quot; events per second esper starts to fall behind in updating all the tree in real time. My interest here is in to know if there is a more intelligent way to approaching this problem or if this is as good as it gets.&lt;br&gt;

&lt;br&gt;Thanks,&lt;br&gt;&lt;br&gt;António Alegria&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Dec 3, 2009 at 9:27 PM, Alexandre Vasseur &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641869&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avasseur@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
What do you mean exactly with &amp;quot;isn&amp;#39;t scalable&amp;quot; and &amp;quot;ineficient&amp;quot; ?&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/3 António Alegria &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641869&amp;i=4&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;div&gt;

&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hi, we have the following problem we are trying to solve with Esper. We have, in fact, reached a solution but it isn&amp;#39;t scalable. The problem has nothing to do with the stockmarket but I will present it as such.&lt;div&gt;



&lt;br&gt;&lt;/div&gt;&lt;div&gt;Suppose Esper receives several StockTick events, with the following fields:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;StockTick:&lt;/div&gt;&lt;div&gt;* symbol: string (e.g. &amp;quot;MSFT&amp;quot;, &amp;quot;APPL&amp;quot;, &amp;quot;GOOG&amp;quot;, ...)&lt;/div&gt;





&lt;div&gt;* price: float&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Furthermore, each StockTick symbol can be associated with grouping hierarchy, such as business field, city, region, country, continent. This grouping information is collected from an SQL query and put in a named window with the following fields:&lt;/div&gt;





&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;GroupTree:&lt;/div&gt;&lt;div&gt;* group: string&lt;/div&gt;&lt;div&gt;* member: string&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example events in this named windows are: [&amp;quot;USA&amp;quot;, &amp;quot;Washington&amp;quot;], [&amp;quot;Washington&amp;quot;, &amp;quot;Redmond&amp;quot;], [&amp;quot;IT&amp;quot;, &amp;quot;MSFT&amp;quot;].&lt;/div&gt;





&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;We want to develop EPL rules that, in real-time and for each arriving StockTick, calculate the average price for each category in this grouping hierarchy (e.g. average for each country, each region, etc...).&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;You can see our current (ineficient solution) in &lt;a rel=&quot;nofollow&quot; href=&quot;https://gist.github.com/f1bec8803ee7de907570&quot; target=&quot;_blank&quot;&gt;https://gist.github.com/f1bec8803ee7de907570&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I would greatly appreciate it if someone could tell me the &amp;quot;right way&amp;quot; to do this.&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;div&gt;António Alegria&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;

&lt;/div&gt;&lt;br&gt;

      &lt;/div&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Real-time-hierarchical-aggregated-statistics-tp26631575p26641869.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26641516</id>
	<title>Re: Real-time hierarchical aggregated statistics</title>
	<published>2009-12-04T03:56:12Z</published>
	<updated>2009-12-04T03:56:12Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div&gt;And that is what version?&lt;br&gt;&lt;/div&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;-Tom&lt;br&gt;&lt;div style=&quot;font-family: times new roman,new york,times,serif; font-size: 12pt;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; António Alegria &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641516&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641516&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Fri, December 4, 2009 6:43:56 AM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] Real-time hierarchical aggregated statistics&lt;br&gt;&lt;/font&gt;&lt;br&gt;
&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;off&quot;&gt;Well, with 10 &quot;StockTick&quot; events per second esper starts to fall behind in updating all the tree in real time. My interest here is in to know if there is a more intelligent way to approaching this problem or if this is as good as it gets.&lt;br&gt;
&lt;br&gt;Thanks,&lt;br&gt;&lt;br&gt;António Alegria&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Dec 3, 2009 at 9:27 PM, Alexandre Vasseur &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641516&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avasseur@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
What do you mean exactly with &quot;isn't scalable&quot; and &quot;ineficient&quot; ?&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/3 António Alegria &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641516&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hi, we have the following problem we are trying to solve with Esper. We have, in fact, reached a solution but it isn't scalable. The problem has nothing to do with the stockmarket but I will present it as such.&lt;div&gt;


&lt;br&gt;&lt;/div&gt;&lt;div&gt;Suppose Esper receives several StockTick events, with the following fields:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;StockTick:&lt;/div&gt;&lt;div&gt;* symbol: string (e.g. &quot;MSFT&quot;, &quot;APPL&quot;, &quot;GOOG&quot;, ...)&lt;/div&gt;




&lt;div&gt;* price: float&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Furthermore, each StockTick symbol can be associated with grouping hierarchy, such as business field, city, region, country, continent. This grouping information is collected from an SQL query and put in a named window with the following fields:&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;GroupTree:&lt;/div&gt;&lt;div&gt;* group: string&lt;/div&gt;&lt;div&gt;* member: string&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example events in this named windows are: [&quot;USA&quot;, &quot;Washington&quot;], [&quot;Washington&quot;, &quot;Redmond&quot;], [&quot;IT&quot;, &quot;MSFT&quot;].&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;We want to develop EPL rules that, in real-time and for each arriving StockTick, calculate the average price for each category in this grouping hierarchy (e.g. average for each country, each region, etc...).&lt;/div&gt;



&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;You can see our current (ineficient solution) in &lt;a rel=&quot;nofollow&quot; target=&quot;_blank&quot; href=&quot;https://gist.github.com/f1bec8803ee7de907570&quot;&gt;https://gist.github.com/f1bec8803ee7de907570&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I would greatly appreciate it if someone could tell me the &quot;right way&quot; to do this.&lt;/div&gt;



&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;div&gt;António Alegria&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;meta http-equiv=&quot;x-dns-prefetch-control&quot; content=&quot;on&quot;&gt;&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg22.c1.mail.mud.yahoo.com compressed/chunked Thu Dec  3 20:18:33 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Real-time-hierarchical-aggregated-statistics-tp26631575p26641516.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26641399</id>
	<title>Re: Real-time hierarchical aggregated statistics</title>
	<published>2009-12-04T03:43:56Z</published>
	<updated>2009-12-04T03:43:56Z</updated>
	<author>
		<name>António Alegria</name>
	</author>
	<content type="html">Well, with 10 &amp;quot;StockTick&amp;quot; events per second esper starts to fall behind in updating all the tree in real time. My interest here is in to know if there is a more intelligent way to approaching this problem or if this is as good as it gets.&lt;br&gt;
&lt;br&gt;Thanks,&lt;br&gt;&lt;br&gt;António Alegria&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Dec 3, 2009 at 9:27 PM, Alexandre Vasseur &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641399&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avasseur@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
What do you mean exactly with &amp;quot;isn&amp;#39;t scalable&amp;quot; and &amp;quot;ineficient&amp;quot; ?&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/3 António Alegria &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26641399&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;div&gt;
&lt;div&gt;&lt;/div&gt;&lt;div class=&quot;h5&quot;&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hi, we have the following problem we are trying to solve with Esper. We have, in fact, reached a solution but it isn&amp;#39;t scalable. The problem has nothing to do with the stockmarket but I will present it as such.&lt;div&gt;


&lt;br&gt;&lt;/div&gt;&lt;div&gt;Suppose Esper receives several StockTick events, with the following fields:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;StockTick:&lt;/div&gt;&lt;div&gt;* symbol: string (e.g. &amp;quot;MSFT&amp;quot;, &amp;quot;APPL&amp;quot;, &amp;quot;GOOG&amp;quot;, ...)&lt;/div&gt;




&lt;div&gt;* price: float&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Furthermore, each StockTick symbol can be associated with grouping hierarchy, such as business field, city, region, country, continent. This grouping information is collected from an SQL query and put in a named window with the following fields:&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;GroupTree:&lt;/div&gt;&lt;div&gt;* group: string&lt;/div&gt;&lt;div&gt;* member: string&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example events in this named windows are: [&amp;quot;USA&amp;quot;, &amp;quot;Washington&amp;quot;], [&amp;quot;Washington&amp;quot;, &amp;quot;Redmond&amp;quot;], [&amp;quot;IT&amp;quot;, &amp;quot;MSFT&amp;quot;].&lt;/div&gt;




&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;We want to develop EPL rules that, in real-time and for each arriving StockTick, calculate the average price for each category in this grouping hierarchy (e.g. average for each country, each region, etc...).&lt;/div&gt;



&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;You can see our current (ineficient solution) in &lt;a href=&quot;https://gist.github.com/f1bec8803ee7de907570&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/f1bec8803ee7de907570&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I would greatly appreciate it if someone could tell me the &amp;quot;right way&amp;quot; to do this.&lt;/div&gt;



&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;div&gt;António Alegria&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;br&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Real-time-hierarchical-aggregated-statistics-tp26631575p26641399.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26640967</id>
	<title>Re: Searching for a better way</title>
	<published>2009-12-04T03:00:45Z</published>
	<updated>2009-12-04T03:00:45Z</updated>
	<author>
		<name>Thomas Bernhardt</name>
	</author>
	<content type="html">&lt;html&gt;&lt;head&gt;&lt;/head&gt;&lt;body&gt;&lt;div style=&quot;font-family:arial,helvetica,sans-serif;font-size:10pt&quot;&gt;&lt;div style=&quot;font-family: arial,helvetica,sans-serif; font-size: 10pt;&quot;&gt;Patterns deliver composite events, i.e. &quot;a=A -&amp;gt; b=B&quot; delivers A and B as a property to the complex output event, including arrays if using the pattern repeat operator.&lt;br&gt;Match recognize also delivers array and composite/complex output events.&lt;br&gt;-Tom&lt;br&gt;&lt;div style=&quot;font-family: times new roman,new york,times,serif; font-size: 12pt;&quot;&gt;&lt;font face=&quot;Tahoma&quot; size=&quot;2&quot;&gt;&lt;hr size=&quot;1&quot;&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;From:&lt;/span&gt;&lt;/b&gt; Alexandre Vasseur &amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26640967&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;avasseur@...&lt;/a&gt;&amp;gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;To:&lt;/span&gt;&lt;/b&gt; &lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26640967&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;user@...&lt;/a&gt;&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Sent:&lt;/span&gt;&lt;/b&gt; Fri, December 4, 2009 4:02:20 AM&lt;br&gt;&lt;b&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;Subject:&lt;/span&gt;&lt;/b&gt; Re: [esper-user] Searching for a better
 way&lt;br&gt;&lt;/font&gt;&lt;br&gt;
Hi&lt;br&gt;Have a look at&lt;br&gt;&lt;span&gt;&lt;a target=&quot;_blank&quot; href=&quot;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl-views.html#view-win-length-batch&quot; rel=&quot;nofollow&quot;&gt;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl-views.html#view-win-length-batch&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&lt;span&gt;
&lt;a target=&quot;_blank&quot; href=&quot;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/processingmodel.html#processingmodel_batch&quot; rel=&quot;nofollow&quot;&gt;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/processingmodel.html#processingmodel_batch&lt;/a&gt;&lt;/span&gt;&lt;br&gt;&lt;span&gt;
&lt;a target=&quot;_blank&quot; href=&quot;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl_clauses.html#epl-output-rate&quot; rel=&quot;nofollow&quot;&gt;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl_clauses.html#epl-output-rate&lt;/a&gt;&lt;/span&gt;&lt;br&gt;
&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Dec 3, 2009 at 11:35 PM, Nicolas Dufour &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26640967&amp;i=2&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nrdufour@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Hello&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I'm fairly new to Esper and building a new engine in order to associate events that share certain criteria into a new event.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I'm trying to see what is the best way to aggregate n events that have the same property into a listener.&lt;/div&gt;

&lt;div&gt;By aggregate here I mean the listener actually receives those n events as one array and not n calls of the update listener method.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;event1(p = foo, status = warning)&lt;/div&gt;

&lt;div&gt;event2(p = bar, status = warning)&lt;/div&gt;&lt;div&gt;event3(p = foo, status = warning)&lt;/div&gt;&lt;div&gt;event4(p = foo, status = down) &amp;nbsp;--&amp;gt; fires the listener with the newEvents array containing event1, event3 and event4&lt;/div&gt;&lt;div&gt;

&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you&lt;/div&gt;&lt;div&gt;&lt;br clear=&quot;all&quot;&gt;Nicolas Dufour&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26640967&amp;i=3&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nrdufour@...&lt;/a&gt;&lt;br&gt;&lt;br&gt;--&lt;br&gt;“Investment in knowledge pays the best interest.”&lt;br&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; —Benjamin Franklin&lt;br&gt;


&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;!-- cg22.c1.mail.mud.yahoo.com compressed/chunked Thu Dec  3 20:18:33 PST 2009 --&gt;
&lt;/div&gt;&lt;br&gt;

      &lt;/body&gt;&lt;/html&gt;</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Searching-for-a-better-way-tp26634520p26640967.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26639566</id>
	<title>Re: Searching for a better way</title>
	<published>2009-12-04T01:02:20Z</published>
	<updated>2009-12-04T01:02:20Z</updated>
	<author>
		<name>Alexandre Vasseur</name>
	</author>
	<content type="html">Hi&lt;br&gt;Have a look at&lt;br&gt;&lt;a href=&quot;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl-views.html#view-win-length-batch&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl-views.html#view-win-length-batch&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/processingmodel.html#processingmodel_batch&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/processingmodel.html#processingmodel_batch&lt;/a&gt;&lt;br&gt;
&lt;a href=&quot;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl_clauses.html#epl-output-rate&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;http://esper.codehaus.org/esper-3.2.0/doc_20091026/reference/en/html/epl_clauses.html#epl-output-rate&lt;/a&gt;&lt;br&gt;
&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;On Thu, Dec 3, 2009 at 11:35 PM, Nicolas Dufour &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26639566&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nrdufour@...&lt;/a&gt;&amp;gt;&lt;/span&gt; wrote:&lt;br&gt;&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;
Hello&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m fairly new to Esper and building a new engine in order to associate events that share certain criteria into a new event.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m trying to see what is the best way to aggregate n events that have the same property into a listener.&lt;/div&gt;

&lt;div&gt;By aggregate here I mean the listener actually receives those n events as one array and not n calls of the update listener method.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;event1(p = foo, status = warning)&lt;/div&gt;

&lt;div&gt;event2(p = bar, status = warning)&lt;/div&gt;&lt;div&gt;event3(p = foo, status = warning)&lt;/div&gt;&lt;div&gt;event4(p = foo, status = down)  --&amp;gt; fires the listener with the newEvents array containing event1, event3 and event4&lt;/div&gt;&lt;div&gt;

&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you&lt;/div&gt;&lt;div&gt;&lt;br clear=&quot;all&quot;&gt;Nicolas Dufour&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26639566&amp;i=1&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nrdufour@...&lt;/a&gt;&lt;br&gt;&lt;br&gt;--&lt;br&gt;“Investment in knowledge pays the best interest.”&lt;br&gt;                               —Benjamin Franklin&lt;br&gt;


&lt;/div&gt;
&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Searching-for-a-better-way-tp26634520p26639566.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26634520</id>
	<title>Searching for a better way</title>
	<published>2009-12-03T14:35:34Z</published>
	<updated>2009-12-03T14:35:34Z</updated>
	<author>
		<name>Nicolas Dufour-4</name>
	</author>
	<content type="html">Hello&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m fairly new to Esper and building a new engine in order to associate events that share certain criteria into a new event.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I&amp;#39;m trying to see what is the best way to aggregate n events that have the same property into a listener.&lt;/div&gt;
&lt;div&gt;By aggregate here I mean the listener actually receives those n events as one array and not n calls of the update listener method.&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;event1(p = foo, status = warning)&lt;/div&gt;
&lt;div&gt;event2(p = bar, status = warning)&lt;/div&gt;&lt;div&gt;event3(p = foo, status = warning)&lt;/div&gt;&lt;div&gt;event4(p = foo, status = down)  --&amp;gt; fires the listener with the newEvents array containing event1, event3 and event4&lt;/div&gt;&lt;div&gt;
&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you&lt;/div&gt;&lt;div&gt;&lt;br clear=&quot;all&quot;&gt;Nicolas Dufour&lt;br&gt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26634520&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;nrdufour@...&lt;/a&gt;&lt;br&gt;&lt;br&gt;--&lt;br&gt;“Investment in knowledge pays the best interest.”&lt;br&gt;                               —Benjamin Franklin&lt;br&gt;

&lt;/div&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Searching-for-a-better-way-tp26634520p26634520.html" />
</entry>

<entry>
	<id>tag:old.nabble.com,2006:post-26633467</id>
	<title>Re: Real-time hierarchical aggregated statistics</title>
	<published>2009-12-03T13:27:11Z</published>
	<updated>2009-12-03T13:27:11Z</updated>
	<author>
		<name>Alexandre Vasseur</name>
	</author>
	<content type="html">What do you mean exactly with &amp;quot;isn&amp;#39;t scalable&amp;quot; and &amp;quot;ineficient&amp;quot; ?&lt;br&gt;Alex&lt;br&gt;&lt;br&gt;&lt;div class=&quot;gmail_quote&quot;&gt;2009/12/3 António Alegria &lt;span dir=&quot;ltr&quot;&gt;&amp;lt;&lt;a href=&quot;http://old.nabble.com/user/SendEmail.jtp?type=post&amp;post=26633467&amp;i=0&quot; target=&quot;_top&quot; rel=&quot;nofollow&quot;&gt;antoniomcalegria@...&lt;/a&gt;&amp;gt;&lt;/span&gt;&lt;br&gt;
&lt;blockquote class=&quot;gmail_quote&quot; style=&quot;border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;&quot;&gt;Hi, we have the following problem we are trying to solve with Esper. We have, in fact, reached a solution but it isn&amp;#39;t scalable. The problem has nothing to do with the stockmarket but I will present it as such.&lt;div&gt;

&lt;br&gt;&lt;/div&gt;&lt;div&gt;Suppose Esper receives several StockTick events, with the following fields:&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;StockTick:&lt;/div&gt;&lt;div&gt;* symbol: string (e.g. &amp;quot;MSFT&amp;quot;, &amp;quot;APPL&amp;quot;, &amp;quot;GOOG&amp;quot;, ...)&lt;/div&gt;



&lt;div&gt;* price: float&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Furthermore, each StockTick symbol can be associated with grouping hierarchy, such as business field, city, region, country, continent. This grouping information is collected from an SQL query and put in a named window with the following fields:&lt;/div&gt;



&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;GroupTree:&lt;/div&gt;&lt;div&gt;* group: string&lt;/div&gt;&lt;div&gt;* member: string&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Example events in this named windows are: [&amp;quot;USA&amp;quot;, &amp;quot;Washington&amp;quot;], [&amp;quot;Washington&amp;quot;, &amp;quot;Redmond&amp;quot;], [&amp;quot;IT&amp;quot;, &amp;quot;MSFT&amp;quot;].&lt;/div&gt;



&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;We want to develop EPL rules that, in real-time and for each arriving StockTick, calculate the average price for each category in this grouping hierarchy (e.g. average for each country, each region, etc...).&lt;/div&gt;


&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;div&gt;You can see our current (ineficient solution) in &lt;a href=&quot;https://gist.github.com/f1bec8803ee7de907570&quot; target=&quot;_blank&quot; rel=&quot;nofollow&quot;&gt;https://gist.github.com/f1bec8803ee7de907570&lt;/a&gt;&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;I would greatly appreciate it if someone could tell me the &amp;quot;right way&amp;quot; to do this.&lt;/div&gt;


&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;div&gt;Thank you,&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;&lt;font color=&quot;#888888&quot;&gt;&lt;div&gt;António Alegria&lt;/div&gt;&lt;div&gt;&lt;br&gt;&lt;/div&gt;
&lt;/font&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;br&gt;
</content>
	<link rel="alternate" type="text/html" href="http://old.nabble.com/Real-time-hierarchical-aggregated-statistics-tp26631575p26633467.html" />
</entry>

</feed>
