Use a UNION operator in your CCL query to combine the results of two or more queries into a single result.
If the UNION is on a Window or Delta Stream, duplicate rows are eliminated from the result set due to the primary key. If the UNION is on a Stream, duplicates flow through.
CREATE INPUT WINDOW InStocks
SCHEMA StocksSchema
Primary Key (Ts)
;
CREATE INPUT WINDOW InOptions
SCHEMA OptionsSchema
Primary Key (Ts)
;
CREATE output Window Union1
SCHEMA OptionsSchema
PRIMARY KEY DEDUCED
AS SELECT s.Ts as Ts, s.Symbol as StockSymbol,
Null as OptionSymbol, s.Price as Price, s.Volume as Volume
FROM InStocks s
UNION
SELECT s.Ts as Ts, s.StockSymbol as StockSymbol,
s.OptionSymbol as OptionSymbol, s.Price as Price,
s.Volume as Volume
FROM InOptions s
;