You can designate streams, windows, and delta streams as input, output, or local.
Input streams and windows can accept data from a source external to the project using an input adapter or by connecting to an external publisher. You can attach an output adapter or connect external subscribers directly to an input window or input stream. You can also use the SQL interface to SELECT rows from an input window, INSERT rows in an input stream or INSERT/UPDATE/DELETE rows in an input window.
Output windows, streams and delta streams can publish data to an output adapter or an external subscriber. You can use the SQL interface to query (that is SELECT) rows from an output window.
Local streams, windows, and delta streams are invisible outside the project and cannot have input or output adapters attached to them. You cannot subscribe to or use the SQL interface to query the contents of local streams, windows, or delta streams.
CREATE SCHEMA mySchema (Col1 INTEGER, Col2 STRING); CREATE INPUT STREAM IStr2 SCHEMA mySchema WHERE IStr2.Col2='abcd';
CREATE OUTPUT STREAM OStr1 AS SELECT A.Col1 col1, A.Col2 col2 FROM IStr1 A;
CREATE SCHEMA mySchema (Col1 INTEGER, Col2 STRING); CREATE MEMORY STORE myStore; CREATE INPUT WINDOW IWin1 SCHEMA mySchema PRIMARY KEY(Col1) STORE myStore;
CREATE SCHEMA mySchema (Col1 INTEGER, Col2 STRING); CREATE MEMORY STORE myStore; CREATE OUTPUT WINDOW OWin1 PRIMARY KEY (Col1) STORE myStore AS SELECT A.Col1 col1, A.Col2 col2 FROM IWin1 A;
Use a local stream, window, or delta stream when the stream does not need an adapter, or to allow outside connections. Local streams, windows, and delta streams are visible only inside the containing CCL project, which allows for more optimizations by the CCL compiler. Streams and windows that do not have a qualifier are local.
CREATE SCHEMA mySchema (Col1 INTEGER, Col2 STRING); CREATE LOCAL STREAM LStr1 AS SELECT i.Col1 col1, i.Col2 col2 FROM IStr1 i;
CREATE SCHEMA mySchema (Col1 INTEGER, Col2 STRING); CREATE MEMORY STORE myStore; CREATE LOCAL WINDOW LWin1 PRIMARY KEY (Col1) STORE myStore AS SELECT i.Col1 col1, i.Col2 col2 FROM IStr1 i;