repeat operator precedence over subexpressions

View: New views
5 Messages — Rating Filter:   Alert me  

repeat operator precedence over subexpressions

by sbuster :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm trying to write the expression every [2](A->B).  Based on the documentation, I thought the fact that the A->B expression is in (), it would be evaluated first, and then the repeat would be applied.  So the A->B expression would be evaluated independent of the [repeat].  However, when I try to match a B event with the same "id" as the preceding A event, the engine expects the "id" attribute to be indexed.  This expression works 'every[2](a=A->b=B(id=a[0].id))'.  Why do I need to use the array index syntax?  Can someone help?

Thanks

Re: re[esper-user] peat operator precedence over subexpressions

by Thomas Bernhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
When a subexpression is within a repeat, all tags in the filters of the subexpressions become array-type since the repeat matches multiple times, i.e. the subexpression A->B and repeat 2 will have 2 A events and 2 B events to indicate.

Best regards,
Tom

From: sbuster <stevebuster911@...>
To: user@...
Sent: Wednesday, June 24, 2009 9:34:46 AM
Subject: [esper-user] re[esper-user] peat operator precedence over subexpressions


I'm trying to write the expression every [2](A->B).  Based on the
documentation, I thought the fact that the A->B expression is in (), it
would be evaluated first, and then the repeat would be applied.  So the A->B
expression would be evaluated independent of the [repeat].  However, when I
try to match a B event with the same "id" as the preceding A event, the
engine expects the "id" attribute to be indexed.  This expression works
'every[2](a=A->b=B(id=a[0].id))'.  Why do I need to use the array index
syntax?  Can someone help?

Thanks

--
View this message in context: http://www.nabble.com/repeat-operator-precedence-over-subexpressions-tp24184902p24184902.html
Sent from the Esper User list mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Re: re[esper-user] peat operator precedence over subexpressions

by sbuster :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

ok, so when I have the following query "select a from pattern [ every [2](a=Event() -> b=Event(eventID=a[0].eventID))]" I get the following error, any thoughts why this is happening
Exception in thread "main" com.espertech.esper.client.EPException: java.lang.ClassCastException: com.espertech.esper.event.bean.BeanEventBean
        at com.espertech.esper.core.EPRuntimeImpl.processWrappedEvent(EPRuntimeImpl.java:354)
        at com.espertech.esper.core.EPRuntimeImpl.processEvent(EPRuntimeImpl.java:341)
        at com.espertech.esper.core.EPRuntimeImpl.sendEvent(EPRuntimeImpl.java:190)
        at cat.dds.nh.Driver.testRepeat2(Driver.java:46)
        at cat.dds.nh.Driver.main(Driver.java:33)
Caused by: java.lang.ClassCastException: com.espertech.esper.event.bean.BeanEventBean
        at com.espertech.esper.filter.FilterSpecParamEventPropIndexed.getFilterValue(FilterSpecParamEventPropIndexed.java:93)
        at com.espertech.esper.filter.FilterSpecCompiled.getValueSet(FilterSpecCompiled.java:114)
        at com.espertech.esper.pattern.EvalFilterStateNode.startFiltering(EvalFilterStateNode.java:174)
        at com.espertech.esper.pattern.EvalFilterStateNode.start(EvalFilterStateNode.java:69)
        at com.espertech.esper.pattern.EvalFollowedByStateNode.evaluateTrue(EvalFollowedByStateNode.java:111)
        at com.espertech.esper.pattern.EvalFilterStateNode.evaluateTrue(EvalFilterStateNode.java:85)
        at com.espertech.esper.pattern.EvalFilterStateNode.matchFound(EvalFilterStateNode.java:143)
        at com.espertech.esper.core.EPRuntimeImpl.processStatementFilterSingle(EPRuntimeImpl.java:981)
        at com.espertech.esper.core.EPRuntimeImpl.processMatches(EPRuntimeImpl.java:776)
        at com.espertech.esper.core.EPRuntimeImpl.processWrappedEvent(EPRuntimeImpl.java:350)
        ... 4 more


Thomas Bernhardt wrote:
When a subexpression is within a repeat, all tags in the filters of the subexpressions become array-type since the repeat matches multiple times, i.e. the subexpression A->B and repeat 2 will have 2 A events and 2 B events to indicate.

Best regards,
Tom


________________________________
From: sbuster <stevebuster911@hotmail.com>
To: user@esper.codehaus.org
Sent: Wednesday, June 24, 2009 9:34:46 AM
Subject: [esper-user] re[esper-user] peat operator precedence over subexpressions


I'm trying to write the expression every [2](A->B).  Based on the
documentation, I thought the fact that the A->B expression is in (), it
would be evaluated first, and then the repeat would be applied.  So the A->B
expression would be evaluated independent of the [repeat].  However, when I
try to match a B event with the same "id" as the preceding A event, the
engine expects the "id" attribute to be indexed.  This expression works
'every[2](a=A->b=B(id=a[0].id))'.  Why do I need to use the array index
syntax?  Can someone help?

Thanks

--
View this message in context: http://www.nabble.com/repeat-operator-precedence-over-subexpressions-tp24184902p24184902.html
Sent from the Esper User list mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


     

Re: Re: re[esper-user] peat operator precedence over subexpressions

by Thomas Bernhardt :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Some parts of this message have been removed. Learn more about Nabble's security policy.
Hi Steve,
I have created a JIRA for this http://jira.codehaus.org/browse/ESPER-370
Best regards,
Tom

From: sbuster <stevebuster911@...>
To: user@...
Sent: Sunday, June 28, 2009 12:14:28 PM
Subject: [esper-user] Re: re[esper-user] peat operator precedence over subexpressions


ok, so when I have the following query "select a from pattern [ every
[2](a=Event() -> b=Event(eventID=a[0].eventID))]" I get the following error,
any thoughts why this is happening
Exception in thread "main" com.espertech.esper.client.EPException:
java.lang.ClassCastException: com.espertech.esper.event.bean.BeanEventBean
    at
com.espertech.esper.core.EPRuntimeImpl.processWrappedEvent(EPRuntimeImpl.java:354)
    at
com.espertech.esper.core.EPRuntimeImpl.processEvent(EPRuntimeImpl.java:341)
    at com.espertech.esper.core.EPRuntimeImpl.sendEvent(EPRuntimeImpl.java:190)
    at cat.dds.nh.Driver.testRepeat2(Driver.java:46)
    at cat.dds.nh.Driver.main(Driver.java:33)
Caused by: java.lang.ClassCastException:
com.espertech.esper.event.bean.BeanEventBean
    at
com.espertech.esper.filter.FilterSpecParamEventPropIndexed.getFilterValue(FilterSpecParamEventPropIndexed.java:93)
    at
com.espertech.esper.filter.FilterSpecCompiled.getValueSet(FilterSpecCompiled.java:114)
    at
com.espertech.esper.pattern.EvalFilterStateNode.startFiltering(EvalFilterStateNode.java:174)
    at
com.espertech.esper.pattern.EvalFilterStateNode.start(EvalFilterStateNode.java:69)
    at
com.espertech.esper.pattern.EvalFollowedByStateNode.evaluateTrue(EvalFollowedByStateNode.java:111)
    at
com.espertech.esper.pattern.EvalFilterStateNode.evaluateTrue(EvalFilterStateNode.java:85)
    at
com.espertech.esper.pattern.EvalFilterStateNode.matchFound(EvalFilterStateNode.java:143)
    at
com.espertech.esper.core.EPRuntimeImpl.processStatementFilterSingle(EPRuntimeImpl.java:981)
    at
com.espertech.esper.core.EPRuntimeImpl.processMatches(EPRuntimeImpl.java:776)
    at
com.espertech.esper.core.EPRuntimeImpl.processWrappedEvent(EPRuntimeImpl.java:350)
    ... 4 more



Thomas Bernhardt wrote:

>
> When a subexpression is within a repeat, all tags in the filters of the
> subexpressions become array-type since the repeat matches multiple times,
> i.e. the subexpression A->B and repeat 2 will have 2 A events and 2 B
> events to indicate.
>
> Best regards,
> Tom
>
>
> ________________________________
> From: sbuster <stevebuster911@...>
> To: user@...
> Sent: Wednesday, June 24, 2009 9:34:46 AM
> Subject: [esper-user] re[esper-user] peat operator precedence over
> subexpressions
>
>
> I'm trying to write the expression every [2](A->B).  Based on the
> documentation, I thought the fact that the A->B expression is in (), it
> would be evaluated first, and then the repeat would be applied.  So the
> A->B
> expression would be evaluated independent of the [repeat].  However, when
> I
> try to match a B event with the same "id" as the preceding A event, the
> engine expects the "id" attribute to be indexed.  This expression works
> 'every[2](a=A->b=B(id=a[0].id))'.  Why do I need to use the array index
> syntax?  Can someone help?
>
> Thanks
>
> --
> View this message in context:
> http://www.nabble.com/repeat-operator-precedence-over-subexpressions-tp24184902p24184902.html
> Sent from the Esper User list mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>
>     
>

--
View this message in context: http://www.nabble.com/repeat-operator-precedence-over-subexpressions-tp24184902p24242862.html
Sent from the Esper User list mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email




Re: repeat operator precedence over subexpressions

by sbuster :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

It's fixed in 3.2!


sbuster wrote:
I'm trying to write the expression every [2](A->B).  Based on the documentation, I thought the fact that the A->B expression is in (), it would be evaluated first, and then the repeat would be applied.  So the A->B expression would be evaluated independent of the [repeat].  However, when I try to match a B event with the same "id" as the preceding A event, the engine expects the "id" attribute to be indexed.  This expression works 'every[2](a=A->b=B(id=a[0].id))'.  Why do I need to use the array index syntax?  Can someone help?

Thanks