Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

from <event-regular-expression-of-streams> within <time>
insert into <stream-name> <attribute-name> {<attribute-name>}

...

When “within <time>” is used, just like with patterns, Siddhi will output only the events that are within that time of each other.

After one or more occurrence of infoStock event with action == "buy", the query matches StockExchangeStream events with maximum of one event with price between 70 and 75 and one event with price >= 75

from every a1 = infoStock[action == "buy"]+,
                b1 = StockExchangeStream[price > 70]?,
               b2 = StockExchangeStream[price >= 75]
insert into StockQuote
            a1[0].action as action, b1.price as priceA, b2.price as priceBJoin

...

Similar to the pattern’s count operation, the ‘*’ and ‘+’ regex operators also output many events occurrences. Hence we have to refer these events using square brackets to access a specific occurrence of that event. In the above example, a1[0] refers to the first matching event arrived via the infoStock stream. 

Excerpt
hiddentrue

Siddhi Sequences in wiki format