A single-row function returns a single value for each event (row) that is the output of a complex event processing statement. These functions can be described at any position where expressions are permitted.
The table below shows the built-in single-row functions.
Function | Syntax | Explanation |
---|---|---|
CASE | case value when comparisonValue then result [when comparisonValue then result] [...] [else result] end | Returns result at the first position where value is equivalent to comparisonValue. |
case when condition then result [when condition then result] [...] [else result] end | Returns result at the first position where condition is TRUE. | |
CAST | cast(expression, dataType) | Converts the expression result to dataType. For dataType, int, long, byte, short, char, double, float, or string can be specified. |
COALESCE | coalesce(expression, expression [,expression] [, ...]) | Returns the value of the first expression in the list that is not null. If all are null, null is returned. |
CURRENT_TIMESTAMP | current_timestamp[()] | Returns the current time using long milliseconds. |
MAX | max(expression, expression [,expression] [, ...]) | Returns the maximum value out of all the expression values. |
MIN | min(expression, expression [,expression] [, ...]) | Returns the minimum value out of all the expression values. |
PREV | prev(expression, property) | Returns the specified property value of the event at the expression value position, counting from the end in the data window, or returns all properties. If the data window has been sorted, it is the position based on that sequence. Specifying a stream name as the property returns all properties. |
PREVTAIL | prevtail(expression, property) | Returns the specified property value of the event at the expression value position, counting from the start in the data window, or returns all properties. If the data window has been sorted, it is the position based on that sequence. Specifying a stream name as the property returns all properties. |
PREVWINDOW | prevwindow(property) | Returns the specified property value for all events in the data window, or returns all properties. Specifying a stream name as the property returns all properties. |
PREVCOUNT | prevcount(property) | Returns the number of events in the data window. For property, specify a property name or a stream name. |
PRIOR | prior(expression, property) | Returns the specified property value of the event at the expression value position, counting from the end of arrived events, or returns all properties. The sequence is the event arrival sequence. Specifying a stream name as the property returns all properties. |