siddhi-io / siddhi

Stream Processing and Complex Event Processing Engine
http://siddhi.io
Apache License 2.0
1.52k stars 527 forks source link

Syntax error in SiddhiQL, no viable alternative at input '"2014-02-15 **:**:** +05:30'. #1821

Open Neil777 opened 1 year ago

Neil777 commented 1 year ago

Description: The example from this link failed to run: https://siddhi.io/en/v5.1/docs/query-guide/#select-named-aggregation

define stream TradeStream (symbol string, price double, volume long, timestamp long);

define aggregation TradeAggregation
  from TradeStream
  select symbol, avg(price) as avgPrice, sum(price) as total
    group by symbol
    aggregate by timestamp every sec ... year;

from TradeAggregation
  on symbol == "FB"
  within "2014-02-15 **:**:** +05:30"
  per "hours"
select symbol, total, avgPrice;

Affected Siddhi Version: siddhi-tooing5.1.2 and siddhi-core-5.1.11

OS, DB, other environment details and versions:

Steps to reproduce:

Java code like:

String app1 = "define stream TradeStream (symbol string, price double, volume long, timestamp long);" +
                " " +
                "define aggregation TradeAggregation from TradeStream select symbol, avg(price) as avgPrice, sum(price) as total group by symbol aggregate by timestamp every sec ... year;"+
                " " +
//                "from TradeAggregation on symbol == \"FB\" within \"2014-02-15 **:**:** +05:30\" per \"hours\" select symbol, total, avgPrice;";
                "from TradeAggregation within \"2014-02-15 00:00:00 +05:30\", \"2014-03-16 00:00:00 +05:30\" per \"days\" select symbol, total, avgPrice;";
//                "from TradeAggregation within \"2014-02-15 00:00:00 +05:30\", \"2014-03-16 00:00:00 +05:30\" per \"days\" select symbol, total, avgPrice;";

        //Generate runtime
        SiddhiAppRuntime siddhiAppRuntime = siddhiManager.createSiddhiAppRuntime(app1);

Related Issues: