我正在学习在cep中使用事件表,但是有一个错误。
from StreamInstance[action contains 'add']#window.length(1)
select *
insert into StreamInstanceTable;
from StreamInstance[action contains 'delete']
delete StreamInstanceTable
on StreamInstanceTable.streamName == StreamInstance.streamName;
当从StreamInstanceTable中删除数据时,如果我采取条件(on)将是错误的,如果没有条件是对的。
[2014-10-23 17:40:28,674] INFO - {RedisListener} recving mesage:{"log": "StreamInstanceTemplateName","streamName": "stream1","moduleCount"
: "4","ip": "127.0.0.1","pid": "1001","from": "container","gid": "gid100","action":"delete"}
[2014-10-23 17:40:28,678] ERROR - {EventJunction} Error while dispatching events
java.lang.ArrayIndexOutOfBoundsException: -1
at org.wso2.siddhi.core.event.StateEvent.getStreamEvent(StateEvent.java:51)
at org.wso2.siddhi.core.executor.expression.VariableExpressionExecutor.execute(VariableExpressionExecutor.java:151)
at org.wso2.siddhi.core.executor.conditon.compare.CompareConditionExecutor.execute(CompareConditionExecutor.java:48)
at org.wso2.siddhi.core.table.InMemoryEventTable.delete(InMemoryEventTable.java:82)
at org.wso2.siddhi.core.query.output.callback.DeleteTableCallback.send(DeleteTableCallback.java:36)
at org.wso2.siddhi.core.query.output.ratelimit.OutputRateManager.sendToCallBacks(OutputRateManager.java:38)
at org.wso2.siddhi.core.query.output.ratelimit.PassThroughOutputRateManager.send(PassThroughOutputRateManager.java:26)
at org.wso2.siddhi.core.query.selector.QuerySelector.process(QuerySelector.java:221)
at org.wso2.siddhi.core.query.processor.handler.SimpleHandlerProcessor.processHandler(SimpleHandlerProcessor.java:149)
at org.wso2.siddhi.core.query.processor.handler.SimpleHandlerProcessor.receive(SimpleHandlerProcessor.java:77)
at org.wso2.siddhi.core.stream.StreamJunction.send(StreamJunction.java:45)
at org.wso2.siddhi.core.stream.input.InputHandler.send(InputHandler.java:41)
at org.wso2.carbon.event.processor.core.internal.listener.SiddhiInputEventDispatcher.sendEvent(SiddhiInputEventDispatcher.java:107)
at org.wso2.carbon.event.processor.core.internal.listener.SiddhiInputEventDispatcher.consumeEventData(SiddhiInputEventDispatcher.jav
a:95)
答案 0 :(得分:0)
您可以尝试以下查询,似乎已知问题(不要将流定义名称用作前缀)
来自StreamInstance的[操作包含'删除'] 删除StreamInstanceTable on StreamInstanceTable.streamName == streamName;