Esper

ClassCastException when using subscriber to join statement with wildcard-select and distinct

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 3.3
  • Fix Version/s: 3.4
  • Component/s: Core
  • Labels:
    None
  • Number of attachments :
    0

Description

Sample statement and code to reproduce:

String epl = "select distinct * from " +
"SupportBean(intPrimitive=0) as fooB unidirectional " +
"inner join " +
"pattern [" +
"every-distinct(fooA.string) fooA=SupportBean(intPrimitive=1)" +
"->" +
"every-distinct(wooA.string) wooA=SupportBean(intPrimitive=2)" +
" where timer:within(1 hour)" +
"].win:time(1 hour) as fooWooPair " +
"on fooB.longPrimitive = fooWooPair.fooA.longPrimitive";

EPStatement stmt = epService.getEPAdministrator().createEPL(epl);
stmt.setSubscriber(subscriber);

log.info("Sending event (fooA) starting pattern subexpression...");
sendEvent("E1", 1, 10L);

log.info("Sending event (wooA 1) matching pattern subexpression...");
sendEvent("E2", 2, 10L);

log.info("Sending event (wooA 2) matching pattern subexpression...");
sendEvent("E3", 2, 10L);

log.info("Sending event (fooB) causing join with matched patterns...");
sendEvent("Query", 0, 10L);

assertTrue(subscriber.isInvoked());

com.espertech.esper.client.EPException: java.lang.ClassCastException: java.lang.Class
at com.espertech.esper.core.EPRuntimeImpl.processWrappedEvent(EPRuntimeImpl.java:402)
at com.espertech.esper.core.EPRuntimeImpl.processEvent(EPRuntimeImpl.java:380)
at com.espertech.esper.core.EPRuntimeImpl.sendEvent(EPRuntimeImpl.java:210)
at com.espertech.esper.regression.view.TestDistinctWildcardJoinPattern.sendEvent(TestDistinctWildcardJoinPattern.java:60)
at com.espertech.esper.regression.view.TestDistinctWildcardJoinPattern.testWildcardJoinPattern(TestDistinctWildcardJoinPattern.java:52)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:40)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:90)
Caused by: java.lang.ClassCastException: java.lang.Class
at com.espertech.esper.event.map.MapEventBeanReader.read(MapEventBeanReader.java:38)
at com.espertech.esper.event.EventBeanUtility.getDistinctByProp(EventBeanUtility.java:492)
at com.espertech.esper.epl.view.OutputProcessViewDistinctOrAfter.process(OutputProcessViewDistinctOrAfter.java:134)
at com.espertech.esper.epl.join.JoinExecutionStrategyImpl.join(JoinExecutionStrategyImpl.java:53)
at com.espertech.esper.epl.join.JoinExecStrategyDispatchable.execute(JoinExecStrategyDispatchable.java:64)
at com.espertech.esper.core.EPStatementHandle.internalDispatch(EPStatementHandle.java:159)
at com.espertech.esper.core.EPRuntimeImpl.processStatementFilterMultiple(EPRuntimeImpl.java:985)
at com.espertech.esper.core.EPRuntimeImpl.processMatches(EPRuntimeImpl.java:840)
at com.espertech.esper.core.EPRuntimeImpl.processWrappedEvent(EPRuntimeImpl.java:398)
... 25 more

Activity

Hide
Thomas Bernhardt added a comment -

As a possible workaround one could use a listener to receive events, as the problem is specific to the use of a subscriber object.

Show
Thomas Bernhardt added a comment - As a possible workaround one could use a listener to receive events, as the problem is specific to the use of a subscriber object.
Hide
Thomas Bernhardt added a comment -

in release 3.4

Show
Thomas Bernhardt added a comment - in release 3.4

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: