Defines a named schema that can be referenced later and reused by one or more queries in the module.
The named schema can inherit the column names and data types of one or more named schemas, created with Create Schema statements elsewhere in the same module. If you include an INHERITS clause in the schema definition, the new schema definition uses the column names and data types of the specified schemas as its first (left-most) columns, in the order listed, and adds any additional columns after the inherited columns.
Named schemas are recognized by all CCL statements within a module, but not by statements outside the module. However, external schema definitions can be imported with the Import statement.
The schema name must be unique within the query module.
All column names within the schema, including any column names inherited by the current schema from another named schema using the INHERITS clause, must be unique.
SCHEMA
The following example creates a schema named trade_schema with two columns named Symbol and Price. The columns have data types of STRING and FLOAT, respectively.
CREATE SCHEMA trade_schema (Symbol STRING, Price FLOAT);
This example uses a different method to create the same schema for trade_schema as in the previous example. The schema inherits the Symbol column definition from symbol_schema, and then defines an additional Price column.
CREATE SCHEMA symbol_schema (Symbol STRING); CREATE SCHEMA trade_schema INHERITS FROM symbol_schema (Price FLOAT);