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
2 AS VALUE_TO_TEST,
1 + VALUE_TO_TEST AS ADD_OPERATOR,
ADD(1, VALUE_TO_TEST) AS ADD_FUNCTION,
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 AS CASE_OPERATOR,
CASE_WHEN(
ARRAY[VALUE_TO_TEST=1, VALUE_TO_TEST=2, VALUE_TO_TEST=3],
ARRAY['ONE', 'TWO', 'THREE'],
'OTHER'
) AS CASE_FUNCTION,
CAST('1' AS BIGINT) AS CAST_OPERATOR,
CAST('1', TYPE 'BIGINT') AS CAST_FUNCTION
;| 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 . For edge cases where operator and function forms behave differently, see Functions Advanced .
Constants
Mathematical constants and system values can be written with or without parentheses — PI and PI() are equivalent:
SELECT
E,
E(),
PI,
PI(),
INFINITY,
INFINITY(),
NAN,
NAN(),
VERSION,
VERSION(),
NULL,
NULL(),
EMPTY,
EMPTY()| ?_0 VARCHAR | ?_1 VARCHAR | ?_2 VARCHAR | ?_3 VARCHAR | ?_4 VARCHAR | ?_5 VARCHAR | ?_6 VARCHAR | ?_7 VARCHAR | ?_8 VARCHAR | ?_9 VARCHAR | ?_10 VARCHAR | ?_11 VARCHAR | ?_12 VARCHAR | ?_13 VARCHAR |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2.718281828459045 | 2.718281828459045 | 3.141592653589793 | 3.141592653589793 | Infinity | Infinity | NaN | NaN | 0.0.1 | 0.0.1 | NULL | NULL | EMPTY() | EMPTY() |
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_DISTINCT | [Array, Filtering And Transformation] |
| ARRAY_EXCEPT | [Array, Set Operations] |
| ARRAY_HISTOGRAM | [Array, Aggregation And Statistics] |
| ARRAY_INTERSECT | [Array, Set Operations] |
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 FUNCTION SIGNATURES reveals the type overloads for a function — what input types it accepts and what it returns:
SHOW FUNCTION 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, Arithmetic Date] | [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.