SCHEMA Clause

Provides a schema definition for new streams and windows.

Syntax

SCHEMA name | (column type [,...])

Components

name The name of schema previously defined with a CREATE SCHEMA statement.
column The name of a column.
type The datatype of the column's entries.

Usage

A SCHEMA clause defines the columns and datatypes (inline schema) in a stream or window, or refers to a previously defined named schema. It may also refer to a schema imported from a different CCL file.

The schema clause is mandatory for input streams, input windows and Flex operators. For all other cases it is optional. In which case the schema is implicitly determined by the columns in the projection list.

In the case of UNION, if a schema is not explicitly specified then it is implicitly determine from the first SELECT statement in the UNION.