Hi Asiri, Siddhi language structure changed somewhat on Siddhi-2.0.0 and above from the previous versions. From the execution plan you've provided, seems like you have used CEP 3.0.0 or 3.1.0, which had Siddhi 2.0.0 and 2.1.0 respectively. So queries written for that CEP won't work with Siddhi 1.x.x versions. On those versions, the structure was like
from <in_stream_name>[<filters>]#<window_conditions> insert into <out_stream_name> <attribute1>,<attribute2>,..., <attribute n> Above is the basic structure and not the correct definition. If you are using Siddhi-1.0.1, you can use [1] as a guide to the language structure. (Siddhi version to CEP version mapping is usually *CEP version = Siddhi version + 1.0.0*) By the way, any particular reason to use an older version of Siddhi? [1] https://docs.wso2.com/display/CEP201/Siddhi+Language+Specification Thanks, Lasantha On 4 December 2014 at 21:59, Asiri Liyana Arachchi <[email protected]> wrote: > Hi all, > > I tried to run a siddhi query in a java application which works perfectly > in wso2CEP. > > Query: (which works in wso2CEP) [1] > > from a=obd_speed,b=obd_speedselect b.speed-a.speed as speedDifference,b.time > - a.time as timeInterval, b.time as timeStampinsert into > obd_accele_calculation; > > > Query in the java application ( Used the sample [2] ) > > String queryReference = siddhiManager.addQuery("from cseEventStream > a=cseEventStream , b=cseEventStream " + > > "select b.price - a.price as priceDiff, symbol insert > into StockQuote ;"); > Gives this error [3] > > Siddhi version used is 1.0.1 . > Even failed with 2.1 and 2.2 (built from the source) > > Is the query in a wrong format? > Any thoughts? > > Thank you > > [1] : > https://github.com/Kampana/fyp-obd2/blob/master/cep-extentions/execution-plan > [2] : > https://svn.wso2.org/repos/wso2/people/suho/packs/siddhi/siddhi-1.0.1-wso2v1-samples.zip > [3] : Exception in thread "main" > org.wso2.siddhi.query.compiler.exception.SiddhiPraserException: line 1:21 > mismatched input 'a' expecting 'insert' > > at org.wso2.siddhi.query.compiler.SiddhiCompiler.parseQuery( > SiddhiCompiler.java:104) > > at org.wso2.siddhi.core.SiddhiManager.addQuery(SiddhiManager.java:168) > > at org.wso2.siddhi.sample.TimeWindowSample.main(TimeWindowSample.java:47) > > Caused by: org.wso2.siddhi.query.compiler.exception.SiddhiPraserException: > line 1:21 mismatched input 'a' expecting 'insert' > > at org.wso2.siddhi.query.compiler.SiddhiQLGrammarParser.emitErrorMessage( > SiddhiQLGrammarParser.java:172) > > at org.antlr.runtime.BaseRecognizer.displayRecognitionError( > BaseRecognizer.java:194) > > at org.antlr.runtime.BaseRecognizer.reportError(BaseRecognizer.java:186) > > at org.wso2.siddhi.query.compiler.SiddhiQLGrammarParser.outputStream( > SiddhiQLGrammarParser.java:894) > > at org.wso2.siddhi.query.compiler.SiddhiQLGrammarParser.query( > SiddhiQLGrammarParser.java:690) > > at org.wso2.siddhi.query.compiler.SiddhiCompiler.parseQuery( > SiddhiCompiler.java:95) > > ... 2 more > > > Regards, > > Asiri > > _______________________________________________ > Dev mailing list > [email protected] > http://wso2.org/cgi-bin/mailman/listinfo/dev > > -- *Lasantha Fernando* Software Engineer - Data Technologies Team WSO2 Inc. http://wso2.com email: [email protected] mobile: (+94) 71 5247551
_______________________________________________ Dev mailing list [email protected] http://wso2.org/cgi-bin/mailman/listinfo/dev
