Search in sources :

Example 11 with OnDemandQuery

use of io.siddhi.query.api.execution.query.OnDemandQuery in project siddhi by wso2.

the class QueryStoreTestCase method test2.

@Test
public void test2() {
    OnDemandQuery query = SiddhiCompiler.parseOnDemandQuery("" + "from StockTable " + "select symbol, price " + "group by symbol " + "having (7 > price) ;");
    AssertJUnit.assertNotNull(query);
    StoreQuery api = StoreQuery.query().from(InputStore.store("StockTable")).select(Selector.selector().select("symbol", Expression.variable("symbol")).select(Expression.variable("price")).groupBy(Expression.variable("symbol")).having(Expression.compare(Expression.value(7), Compare.Operator.GREATER_THAN, Expression.variable("price"))));
    AssertJUnit.assertEquals(api, query);
}
Also used : StoreQuery(io.siddhi.query.api.execution.query.StoreQuery) OnDemandQuery(io.siddhi.query.api.execution.query.OnDemandQuery) Test(org.testng.annotations.Test)

Aggregations

OnDemandQuery (io.siddhi.query.api.execution.query.OnDemandQuery)11 OnDemandQueryRuntime (io.siddhi.core.query.OnDemandQueryRuntime)4 Test (org.testng.annotations.Test)4 Event (io.siddhi.core.event.Event)3 MetaStreamEvent (io.siddhi.core.event.stream.MetaStreamEvent)3 StreamEvent (io.siddhi.core.event.stream.StreamEvent)3 ComplexEventChunk (io.siddhi.core.event.ComplexEventChunk)2 SiddhiAppCreationException (io.siddhi.core.exception.SiddhiAppCreationException)2 TimePeriod (io.siddhi.query.api.aggregation.TimePeriod)2 StoreQuery (io.siddhi.query.api.execution.query.StoreQuery)2 SiddhiQueryContext (io.siddhi.core.config.SiddhiQueryContext)1 MetaStateEvent (io.siddhi.core.event.state.MetaStateEvent)1 MetaStateEventAttribute (io.siddhi.core.event.state.MetaStateEventAttribute)1 StateEvent (io.siddhi.core.event.state.StateEvent)1 DataPurgingException (io.siddhi.core.exception.DataPurgingException)1 VariableExpressionExecutor (io.siddhi.core.executor.VariableExpressionExecutor)1 CacheTable (io.siddhi.core.table.CacheTable)1 CacheTableFIFO (io.siddhi.core.table.CacheTableFIFO)1 CacheTableLFU (io.siddhi.core.table.CacheTableLFU)1 CacheTableLRU (io.siddhi.core.table.CacheTableLRU)1