Functions
On this page
Functions calculate values within a ScopeQL query.
Reading a signature
Signatures use the following notation:
<name>: a value or expression you supply.[ ... ]: an optional argument. In array construction, element access, and slicing, the brackets are part of the query itself....: the preceding item can repeat.
Arguments fall into two groups:
- Inputs such as
<expr>can vary by row. - Parameters shown as
name => <value>must be constant expressions. You can also supply them positionally, in the documented order after the input arguments.
For example, split(message, separator => ',') reads message from each row and uses one constant separator. Once a named parameter is used, later arguments must also be named.
Type names such as int, float, and any refer to ScopeQL data types. “Any type” means any supported input type; it does not require an any cast. Use an explicit cast when a column has a different type from the documented argument, for example quantile(amount::float, quantile => 0.95).
Each entry describes its NULL behavior. Omitting an optional parameter uses its default; passing NULL supplies a value, which the function may reject.
Function categories
- Aggregate functions: summarize groups of rows.
- Window functions: calculate a result for each row using related rows.
- System functions: inspect ScopeDB runtime information.
- Scalar functions: calculate a value for each row.