This documentation is for WSO2 Complex Event Processor 2.0.1. View documentation for the latest release.

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Current »

from <stream-name>
insert into <stream-name> ( {<attribute-name>}| ‘*’|)

Pass-through query creates an output stream according to the projection defined and inserts any events from the input stream to the output stream.

Following projections are available for Siddhi queries

1. All
2. Selected attributes

Following example shows sample queries for different projections with pass-through query.

Stream  defined by "define stream StockExchangeStream (symbol string, price int, volume float );" is used in below queries.

All

From all events of the StockExchangeStream stream, output all the events where the output event will have all the input event's attributes.

from StockExchangeStream
insert into StockQuote * ;

                        or

from StockExchangeStream
insert into StockQuote ;

Here since projection is omitted or ‘*’ is used, we are projecting all the input attributes as the output of the query, and hence the output stream ‘StockQuote’ will only contain ‘symbol’, 'price' and ‘volume’ attributes,

Selected attributes

From all events of the StockExchangeStream stream, output all the events where the output event will only have symbol and volume as its attributes.

from StockExchangeStream
insert into StockQuote symbol, volume 

Here we are only projecting ‘symbol’ and ‘volume’ as the output of the query, and hence the output stream ‘StockQuote’ will only contain ‘symbol’ and ‘volume’ attributes.

From all events of the StockExchangeStream stream, output all the events where the output event will only have symbol renamed as companyName and volume as its attributes.

from StockExchangeStream
insert into StockQuote symbol as companyName, volume 

Here we are only projecting ‘symbol’ as 'comapanyName' and ‘volume’ as the output of the query, and hence the output stream ‘StockQuote’ will only contain ‘comapanyName’ and ‘volume’ attributes.

 

  • No labels