Operators & functions
Most operations in FeatureQL can be written two ways: as an operator (+, ||, CASE WHEN) or as a function call (ADD(), CONCAT(), CASE_WHEN()). They produce identical results — pick whichever reads better in context.
Operator and function equivalence
Arithmetic, conditionals, and casting all have both forms:
SELECT
value_to_test := 2,
add_operator := 1 + value_to_test,
add_function := ADD(1, value_to_test),
case_operator := CASE
WHEN value_to_test = 1 THEN 'ONE'
WHEN value_to_test = 2 THEN 'TWO'
WHEN value_to_test = 3 THEN 'THREE'
ELSE 'OTHER'
END,
case_function := CASE_WHEN(
ARRAY(value_to_test = 1, value_to_test = 2, value_to_test = 3),
ARRAY('ONE', 'TWO', 'THREE'),
'OTHER'
),
cast_operator := CAST('1' AS BIGINT),
cast_function := CAST('1', TYPE 'BIGINT')
;| VALUE_TO_TEST BIGINT | ADD_OPERATOR BIGINT | ADD_FUNCTION BIGINT | CASE_OPERATOR VARCHAR | CASE_FUNCTION VARCHAR | CAST_OPERATOR BIGINT | CAST_FUNCTION BIGINT |
|---|---|---|---|---|---|---|
| 2 | 3 | 3 | TWO | TWO | 1 | 1 |
The function forms are useful when you need to build logic dynamically. CASE_WHEN() takes arrays of conditions and values, which makes it easier to construct programmatically than the traditional CASE WHEN ... END syntax. Note that casting also has a function form: CAST('1', TYPE 'BIGINT') is equivalent to CAST('1' AS BIGINT).
For the full catalog, see Operators and Functions .
Constants
Mathematical constants and system values can be written with or without parentheses — PI and PI() are equivalent:
@fql-playground(function_constants)
E, PI, INFINITY, and NAN are the mathematical constants. VERSION returns the FeatureQL version. NULL and EMPTY are the two special values (see Literals for how they differ).
Discovering functions
Browsing available functions
SHOW FUNCTIONS lists functions by name and category. Use LIKE patterns to narrow the results:
SHOW FUNCTIONS (COLUMNS (NAME, CATEGORY)) LIKE 'ARR%' ORDER BY NAME LIMIT 10;| NAME VARCHAR | CATEGORY ARRAY |
|---|---|
| ARRAYS_OVERLAP | [Array, Set Operations] |
| ARRAY_AGG() GROUP BY ... | [Group By, Collection] |
| ARRAY_AGG() OVER ... | [Window Function, Collection] |
| ARRAY_AVG | [Array, Aggregation And Statistics] |
| ARRAY_CONCAT | [Array, Array Combination] |
| ARRAY_CONCAT_FN | [Array, Array Combination] |
| ARRAY_COUNT | [Array, Aggregation And Statistics] |
| ARRAY_DISTINCT | [Array, Filtering And Transformation] |
| ARRAY_ENUMERATE | [Array, Filtering And Transformation] |
| ARRAY_ENUMERATE_FLATTEN | [Array, Filtering And Transformation] |
Results include CATEGORY (as an array like ['Math', 'Arithmetic']), DISPLAY_ORDER for sorting, and optional columns like ALIASES, OPERATOR, PARAMETERS, and NOTES available via INCLUDE.
Inspecting function signatures
SHOW SIGNATURES reveals the type overloads for a function — what input types it accepts and what it returns:
SHOW SIGNATURES (COLUMNS (NAME, CATEGORY, PARAMETER_NAMES, PARAMETER_TYPES, RETURN_TYPE)) WHERE NAME='ADD';| NAME VARCHAR | CATEGORY ARRAY | PARAMETER_NAMES ARRAY | PARAMETER_TYPES ARRAY | RETURN_TYPE VARCHAR |
|---|---|---|---|---|
| ADD | [Date And Time, Date/timestamp arithmetic] | [timestamp, interval] | [TIMESTAMP, INTERVAL] | TIMESTAMP |
| ADD | [Math, Arithmetic] | [number1, number2] | [T, T] | T |
ADD has two signatures: one for numeric types (using the generic T) and one for date/interval arithmetic. PARAMETER_NAMES and PARAMETER_TYPES are arrays, making them easy to process programmatically. Use INCLUDE (GENERICS) to see what concrete types a generic like T accepts.