This guide provides instructions to use the Siddhi Query Language 3.0 with WSO2 DAS using examples.
...
Functions parameters can be attributes ( int
, long, float, double, string, bool, object
), results of other functions, results of mathematical or logical expressions or time parameters.
...
Event tables also support persisting event data in a distributed manner using Hazelcast in-memory data grids. This functionality can easily be enabled using the "From" annotation. Also, the connection instructions for Hazelcast cluster can be assigned to the event table using "From" annotation.
Info |
---|
Connection instructions that can be used with "From" annotation: |
...
To execute update only for the specified output event category instead of "update <table name> on <condition>" code snippet use "update <table name> for <output event category> on <condition>", where "<output event category>" could be "current events", "expired events" or "all events" keywords.
Insert Overwrite
Query for insert or overwrite events on event table can be written using an insert-overwrite query having following syntax
Code Block | ||||
---|---|---|---|---|
| ||||
from <input stream name>
select <attribute name> as <table attribute name>, <attribute name> as <table attribute name>, ...
insert overwrite <table name>
on <condition> |
Here the "on <condition>" can be used to select the events for update or insert, and when writing this condition attribute names of the event tables should be always referred with table name and attributes of the select should not be have reference associated with them.
With "<table attribute name>" the attributes could be referred with the same name thats defined in event table, allowing Siddhi to identify which attributes need to be updated/inserted on event table.
E.g. For each room denoted by its number, update the room types of the RoomTypeTable based on the event sin UpdateStream or insert if it is not exist.
...
language | sql |
---|---|
linenumbers | true |
...
In
Query for checking whether an attribute is in event table can be checked using conditions having the following syntax
...
- math : Supporting mathematical operations
- str : Supporting String operations
- geo : Supporting geocode operations
- regex : Supporting regular expression operations
- time : Supporting time expression operations
- ml : Supporting Machine Learning expression operations
- timeseries : Supporting Time Series operations
- kf (Kalman Filter) : Supporting filtering capabilities by detecting outliers of the data.
- map : Supporting to send a map object inside Siddhi stream definitions and use it inside queries.
- reorder : Supporting for reordering events from an unordered event stream using Kslack algorithm.
...
- geo : Supporting geographical processing operations
- r : Supporting R executions
- nlp : Supporting Natural Language Processing expression operations
- pmml : Supporting Predictive Model Markup Language expression operations
You can get them from https://github.com/wso2-gpl/siddhi
...