A column expression produces a result based on the value of input columns, the relationship of column values to each other, or the computed formulas. It may include built-in or user-defined functions, constants, parameters, or variables.
A simple CCL expression specifies a constant, NULL, or a column. A constant can be a number or a text string. The literal NULL denotes a null value. NULL is never part of another expression, but NULL by itself is an expression.
You can specify a column name by itself or with the name of its stream or window. To specify both the column and the stream or window, use the format "stream_name.column_name."
A compound CCL expression is a combination of simple or compound expressions. Compound expressions can include operators and functions, as well as the simple CCL expressions (constants, columns, or NULL).
You can use parentheses to change the order of precedence of the expression's components.
Each expression defines a unique name or alias for the column.
Alias | Column Expression |
---|---|
Symbol | PriceFeed.Symbol |
LastPrice | PriceFeed.Price |
VWAP | ( sum ( ( PriceFeed.Price * CAST ( FLOAT , PriceFeed.Shares ) ) ) / CAST ( float , sum ( PriceFeed.Shares ) ) ) |
LastTime | PriceFeed.TradeTime |
Datatypes for column expressions are inherited from the schema, either an explicitly created inline schema, or one discovered from the input adapter. You choose from supported datatypes in the schema editor, not in the column expression editor.
Enclose string data in expressions in single quotes, for example, 'my_string_data'.