Introduction to SiddhiQL
Siddhi Query Language (SiddhiQL) is a language designed for processing streams and identify complex event occurrences. This document describes The Siddhi Query Language.
Definition of terms
1. Event Stream - Logical series of events ordered in time.
2. Event Stream Definition - Defines event streams. An event stream has a unique name and a set of typed attributes with uniquely identifiable names that define its schema.
3. Event - An event is associated with one event stream only, and all events of that stream will have an identical set of typed attributes (or the same schema).
4. Attribute - Has a unique name within the event stream, and they will have a type as INT, LONG, BOOL, FLOAT, DOUBLE or STRING
5. Query - A logical construct that modifies the existing streams and derive new streams combining existing streams. Query contains some input streams, handlers to modify those input streams, and an output stream to which it will publish its output events.
Siddhi queries describe how to combine existing event streams to create new event streams. When deployed in the Siddhi runtime, Siddhi queries process incoming event streams, and as
specified by the queries, it generates new output event streams if they don’t exist.
For example, let us consider an event stream called ‘StockExchangeStream’ that has three parameters: ‘symbol’ of type String, ‘prize’ of type float, and ‘volume’ of type int.
from StockExchangeStream[volume <10]
insert into StockQuoteStream symbol, volume
The above query will create a new stream called ‘StockQuoteStream’, that has two attributes as ‘symbol’ of type STRING and ‘volume’ of type INT having events from StockExchangeStream that have the volume attribute less than 10.
Copyright © WSO2 Inc. 2005-2014