Search in sources :

Example 6 with StoreQuery

use of io.siddhi.query.api.execution.query.StoreQuery 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

StoreQuery (io.siddhi.query.api.execution.query.StoreQuery)6 Test (org.testng.annotations.Test)6 OnDemandQuery (io.siddhi.query.api.execution.query.OnDemandQuery)2