Example: Merging Data from Streams or Windows

Use the UNION clause to merge data from two streams or windows and produce a derived element (stream, window, or delta stream).

  1. Create a new window:
    CREATE WINDOW name

    You can also create a new stream or delta stream.

  2. Specify the primary key:
    PRIMARY KEY (…)
  3. Specify the first derived element in the union:
    SELECT * FROM StreamWindow1
  4. Add the UNION clause:
    UNION
  5. Specify the second derived element in the union:
    SELECT * FROM StreamWindow2