Stream and Query
Provides introduction to streams, queries, and how queries can be chained to one another.
There are multiple type of queries such as window query, join query, pattern query, etc. But this example only explains how pass-through and selection queries work. For more info refer the Siddhi query guide.
define stream InputTemperatureStream (
sensorId string, temperature double);
@info(name = 'Pass-through')
from InputTemperatureStream
select *
insert into TemperatureAndSensorStream;
@info(name = 'Simple-selection')
from TemperatureAndSensorStream
select temperature
insert into TemperatureOnlyStream;
|
Defines |
|
Optional |
|
Query to consume events from |
|
|
|
Consumes events from |
|
Selects only the |
Events at each stream
When an event with values ['aq-14'
, 35.4
] is sent to InputTemperatureStream
stream it will get converted and travel through the streams as below.
- InputTemperatureStream : [
'aq-14'
,35.4
] - TemperatureAndSensorStream : [
'aq-14'
,35.4
] - TemperatureOnlyStream : [
35.4
]