All Functions
Show only functions available on
Showing all 427 functions
Backend availability
DD Available DD Partially available DD Not available
Function categories
Core
Semantics
| Function | Description | Backends |
|---|
ENTITY() | Returns a reference to an entity. | DD | PG | CH | TR | BQ | SF | DB | SV |
INPUT() | Declares an input: a typed value that the query binds, such as an entity key. | DD | PG | CH | TR | BQ | SF | DB | SV |
KEY_TO_SCALAR() | Drop the entity annotation and keep the base type and unit | DD | PG | CH | TR | BQ | SF | DB | SV |
KEY_PAIR() | Unordered pair of two identity keys from one family | DD | PG | CH | TR | BQ | SF | DB | SV |
IS_KEY_BEFORE() | True when the first identity key is strictly before the second | DD | PG | CH | TR | BQ | SF | DB | SV |
Bind
| Function | Description | Backends |
|---|
BIND_VALUE() | Binds the given value to the given feature. | DD | PG | CH | TR | BQ | SF | DB | SV |
BIND_VALUES() | Binds the given array of values to the given feature or features. | DD | PG | CH | TR | BQ | SF | DB | SV |
BIND_COLUMNS() | Binds columns from a table to the given features. | DD | PG | CH | TR | BQ | SF | DB | SV |
@BIND_KEYSET(...) | Binds entity keys from a keyset, keyset group, or mapped source. | DD | PG | CH | TR | BQ | SF | DB | SV |
Structural
| Function | Description | Backends |
|---|
RELATED() | Brings a value from another entity: a lookup through a foreign key, or an aggregation of the... | DD | PG | CH | TR | BQ | SF | DB | SV |
UNNEST() | Unnests an array of rows into a table of rows | DD | PG | CH | TR | BQ | SF | DB | SV |
Types
| Function | Description | Backends |
|---|
CAST() | Returns the given expression casted to the given type, or raise an exception if the conversion... | DD | PG | CH | TR | BQ | SF | DB | SV |
UNSAFE_CAST() | Returns the given expression casted to the given type, allowing to change or remove entity type | DD | PG | CH | TR | BQ | SF | DB | SV |
NULL() | Returns a NULL value of the given type. | DD | PG | CH | TR | BQ | SF | DB | SV |
EMPTY() | Returns an EMPTY filling for empty parameters in functions. | DD | PG | CH | TR | BQ | SF | DB | SV |
Functions
| Function | Description | Backends |
|---|
VARIANT() | Recomputes a feature with some of its dependencies replaced by other definitions. | DD | PG | CH | TR | BQ | SF | DB | SV |
MACRO() | Turns a feature expression into a function whose parameters are some of its inputs. | DD | PG | CH | TR | BQ | SF | DB | SV |
UDF() | Defines a polymorphic user-defined function with typed signatures and dialect SQL expressions. | DD | PG | CH | TR | BQ | SF | DB | SV |
Source
Connection
| Function | Description | Backends |
|---|
SECRET() | A secret of the serving engine's environment, for a source's credentials | DD | PG | CH | TR | BQ | SF | DB | SV |
SOURCE_DB() | Creates a connection to an operational database (PostgreSQL, MySQL, DynamoDB), picked by the DSN's... | DD | PG | CH | TR | BQ | SF | DB | SV |
SOURCE_HTTP() | Creates a HTTP connection to the given URI | DD | PG | CH | TR | BQ | SF | DB | SV |
SOURCE_KV() | Creates a connection to a key-value store (Redis), picked by the URI's scheme | DD | PG | CH | TR | BQ | SF | DB | SV |
SOURCE_STREAM() | A stream's broker and record format. Its records are declared with EXTERNAL_COLUMNS(... FROM... | DD | PG | CH | TR | BQ | SF | DB | SV |
Mapping
| Function | Description | Backends |
|---|
EXTERNAL_COLUMNS() | Maps columns of a table, view, SQL query or inline data to a ROW feature. | DD | PG | CH | TR | BQ | SF | DB | SV |
EXTERNAL_KV() | Returns the value of a key (or of a field of a hash) from a key-value source | DD | PG | CH | TR | BQ | SF | DB | SV |
EXTERNAL_HTTP() | Returns the JSON response from a HTTP call | DD | PG | CH | TR | BQ | SF | DB | SV |
Conditional
| Function | Description | Backends |
|---|
NULLIF() | Returns NULL when two values compare equal; otherwise returns the first value | DD | PG | CH | TR | BQ | SF | DB | SV |
IF() | Returns one value if a condition is true, another if false | DD | PG | CH | TR | BQ | SF | DB | SV |
CASE WHEN | Returns the result of the first condition that evaluates to true | DD | PG | CH | TR | BQ | SF | DB | SV |
CASE WHEN VALUE | Returns the result corresponding to the first matching value in a simple case expression | DD | PG | CH | TR | BQ | SF | DB | SV |
COALESCE(...) | Returns the first non-NULL value from a list of values | DD | PG | CH | TR | BQ | SF | DB | SV |
Logical
| Function | Description | Backends |
|---|
AND | Returns TRUE when both boolean operands are TRUE. | DD | PG | CH | TR | BQ | SF | DB | SV |
OR | Returns TRUE when at least one boolean operand is TRUE. | DD | PG | CH | TR | BQ | SF | DB | SV |
NOT | Returns FALSE if the operand is TRUE, TRUE if it is FALSE. | DD | PG | CH | TR | BQ | SF | DB | SV |
Comparison
Equality
| Function | Description | Backends |
|---|
= [equals] | Returns TRUE if the first value equals the second value | DD | PG | CH | TR | BQ | SF | DB | SV |
!= [not] | Returns TRUE if the first value does not equal the second value | DD | PG | CH | TR | BQ | SF | DB | SV |
IS NULL | Returns TRUE if the expression evaluates to NULL. | DD | PG | CH | TR | BQ | SF | DB | SV |
IS NOT NULL | Returns TRUE if the expression does NOT evaluate to NULL. | DD | PG | CH | TR | BQ | SF | DB | SV |
IS NOT DISTINCT FROM | Returns TRUE if two values are not distinct, treating NULL values as comparable. | DD | PG | CH | TR | BQ | SF | DB | SV |
IS DISTINCT FROM | Returns TRUE if two values are distinct, treating NULL values as comparable. | DD | PG | CH | TR | BQ | SF | DB | SV |
Ordering
| Function | Description | Backends |
|---|
< [less] | Returns TRUE if the first value is strictly less than the second value | DD | PG | CH | TR | BQ | SF | DB | SV |
<= [less] | Returns TRUE if the first value is less than or equal to the second value | DD | PG | CH | TR | BQ | SF | DB | SV |
> [greater] | Returns TRUE if the first value is strictly greater than the second value | DD | PG | CH | TR | BQ | SF | DB | SV |
>= [greater] | Returns TRUE if the first value is greater than or equal to the second value | DD | PG | CH | TR | BQ | SF | DB | SV |
BETWEEN | Returns TRUE if a value is within a specified range (inclusive) | DD | PG | CH | TR | BQ | SF | DB | SV |
NOT BETWEEN | Returns TRUE if a value is NOT within a specified range (inclusive). | DD | PG | CH | TR | BQ | SF | DB | SV |
LEAST(...) | Returns the least (minimum) value from a list of arguments. | DD | PG | CH | TR | BQ | SF | DB | SV |
GREATEST(...) | Returns the greatest (maximum) value from a list of arguments. | DD | PG | CH | TR | BQ | SF | DB | SV |
Pattern Matching
| Function | Description | Backends |
|---|
LIKE | Returns TRUE if a string matches a specified pattern with wildcards. | DD | PG | CH | TR | BQ | SF | DB | SV |
NOT LIKE | Returns TRUE if a string does NOT match a specified pattern with wildcards. | DD | PG | CH | TR | BQ | SF | DB | SV |
LIKE multiple | Case-sensitive or case-insensitive pattern matching: `LIKE` / `ILIKE` with `ANY`, `ALL`, or `NONE`... | DD | PG | CH | TR | BQ | SF | DB | SV |
Set Operations
| Function | Description | Backends |
|---|
IN | Returns TRUE if a value exists in a list of values. | DD | PG | CH | TR | BQ | SF | DB | SV |
NOT IN | Returns TRUE if a value does NOT exist in a list of values. | DD | PG | CH | TR | BQ | SF | DB | SV |
Math
Arithmetic
| Function | Description | Backends |
|---|
+ [addition] | Adds two numeric values, or adds an interval to a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
UNARY_MINUS() | Negates a numeric expression (unary minus). | DD | PG | CH | TR | BQ | SF | DB | SV |
UNARY_PLUS() | Explicit unary plus on an expression (no-op on the value). | DD | PG | CH | TR | BQ | SF | DB | SV |
- [subtraction] | Subtracts the right-hand value from the left-hand value (numeric, temporal, or interval forms). | DD | PG | CH | TR | BQ | SF | DB | SV |
FACTORIAL() | Returns the factorial of a non-negative integer (n!). | DD | PG | CH | TR | BQ | SF | DB | SV |
CLAMP() | Constrains a value to a closed interval: the result is the value limited to lie between low and... | DD | PG | CH | TR | BQ | SF | DB | SV |
* [multiplication] | Returns the product of two numbers, or scales an interval by an integer factor. | DD | PG | CH | TR | BQ | SF | DB | SV |
/ [division] | Divides the left-hand number by the right-hand number, producing a DOUBLE result. | DD | PG | CH | TR | BQ | SF | DB | SV |
// [type-preserving] | Divides the left-hand number by the right-hand number while preserving the dividend's type... | DD | PG | CH | TR | BQ | SF | DB | SV |
% [remainder] | Returns the remainder after dividing the left-hand number by the right-hand number. | DD | PG | CH | TR | BQ | SF | DB | SV |
Rounding
| Function | Description | Backends |
|---|
ROUND() | Rounds a number to the nearest integer or to a specified number of decimal places. | DD | PG | CH | TR | BQ | SF | DB | SV |
TRUNCATE() | Returns the integer part of a number by discarding the fractional part. | DD | PG | CH | TR | BQ | SF | DB | SV |
FLOOR() | Returns the largest integer less than or equal to the input. | DD | PG | CH | TR | BQ | SF | DB | SV |
CEIL() | Returns the smallest integer greater than or equal to the input. | DD | PG | CH | TR | BQ | SF | DB | SV |
Sign And Absolute
| Function | Description | Backends |
|---|
ABS() | Returns the absolute value of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
SIGN() | Returns the sign of a number: -1 for negative, 0 for zero, 1 for positive. | DD | PG | CH | TR | BQ | SF | DB | SV |
Exponential
| Function | Description | Backends |
|---|
^ [exponentiation] | Raises a number to a power (integer or floating-point operands of the same type). | DD | PG | CH | TR | BQ | SF | DB | SV |
SQRT() | Returns the square root of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
CBRT() | Returns the cube root of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
EXP() | Returns e raised to the power of the given number. | DD | PG | CH | TR | BQ | SF | DB | SV |
LN() | Returns the natural logarithm (base e) of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
LOG() | Returns the logarithm of a number to a specified base. | DD | PG | CH | TR | BQ | SF | DB | SV |
Trigonometric
| Function | Description | Backends |
|---|
COS() | Returns the cosine of an angle in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
SIN() | Returns the sine of an angle in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
TAN() | Returns the tangent of an angle in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
ACOS() | Returns the arccosine (inverse cosine) of a number, in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
ASIN() | Returns the arcsine (inverse sine) of a number, in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
ATAN() | Returns the arctangent (inverse tangent) of a number, in radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
ATAN2() | Returns the arctangent of y/x, using the signs of both arguments to determine the quadrant. | DD | PG | CH | TR | BQ | SF | DB | SV |
Hyperbolic
| Function | Description | Backends |
|---|
COSH() | Returns the hyperbolic cosine of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
SINH() | Returns the hyperbolic sine of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
TANH() | Returns the hyperbolic tangent of a number. | DD | PG | CH | TR | BQ | SF | DB | SV |
Angle Conversion
| Function | Description | Backends |
|---|
DEGREES() | Converts an angle from radians to degrees. | DD | PG | CH | TR | BQ | SF | DB | SV |
RADIANS() | Converts an angle from degrees to radians. | DD | PG | CH | TR | BQ | SF | DB | SV |
Base Conversion
| Function | Description | Backends |
|---|
FROM_BASE() | Returns the decimal (base 10) equivalent of a number expressed in a specified base. | DD | PG | CH | TR | BQ | SF | DB | SV |
TO_BASE() | Returns the string representation of a decimal number in a specified base. | DD | PG | CH | TR | BQ | SF | DB | SV |
Constant
| Function | Description | Backends |
|---|
E() | Returns the mathematical constant e (Euler's number). | DD | PG | CH | TR | BQ | SF | DB | SV |
PI() | Returns the mathematical constant π (pi). | DD | PG | CH | TR | BQ | SF | DB | SV |
Bucketing
| Function | Description | Backends |
|---|
WIDTH_BUCKET_REGULAR() | Returns the bucket number for a value in equally-spaced buckets within a range. | DD | PG | CH | TR | BQ | SF | DB | SV |
WIDTH_BUCKET() | Returns the bucket number for a value in a histogram with custom bin boundaries. | DD | PG | CH | TR | BQ | SF | DB | SV |
Bitwise
| Function | Description | Backends |
|---|
Bitwise AND | Returns the bitwise AND of two bitstrings or two integers. | DD | PG | CH | TR | BQ | SF | DB | SV |
Bitwise OR | Returns the bitwise OR of two bitstrings or two integers. | DD | PG | CH | TR | BQ | SF | DB | SV |
Bitwise XOR | Returns the bitwise XOR (exclusive OR) of two bitstrings or two integers. | DD | PG | CH | TR | BQ | SF | DB | SV |
Bitwise NOT | Returns the bitwise NOT (complement) of a bitstring or an integer, flipping every bit. | DD | PG | CH | TR | BQ | SF | DB | SV |
Bitwise left shift | Returns the bitstring or integer shifted left by N positions, filling with zeros on the right. | DD | PG | CH | TR | BQ | SF | DB | SV |
Bitwise right shift | Returns the bitstring or integer shifted right by N positions. | DD | PG | CH | TR | BQ | SF | DB | SV |
BIT_COUNT() | Returns the number of 1-bits in the two’s-complement binary representation of an integer. | DD | PG | CH | TR | BQ | SF | DB | SV |
String
Case Conversion
| Function | Description | Backends |
|---|
LOWER() | Returns the string with all characters converted to lowercase. | DD | PG | CH | TR | BQ | SF | DB | SV |
UPPER() | Returns the string with all characters converted to uppercase. | DD | PG | CH | TR | BQ | SF | DB | SV |
TITLE() | Returns the string with the first letter of each whitespace-delimited word in uppercase and the... | DD | PG | CH | TR | BQ | SF | DB | SV |
Padding And Trimming
| Function | Description | Backends |
|---|
TRIM() | Returns the string with whitespace from both ends removed. | DD | PG | CH | TR | BQ | SF | DB | SV |
LTRIM() | Returns the string with whitespace from the left (beginning) removed. | DD | PG | CH | TR | BQ | SF | DB | SV |
RTRIM() | Returns the string with whitespace from the right (end) removed. | DD | PG | CH | TR | BQ | SF | DB | SV |
LPAD() | Returns the string padded on the left to a specified length with a padding string. | DD | PG | CH | TR | BQ | SF | DB | SV |
RPAD() | Returns the string padded on the right to a specified length with a padding string. | DD | PG | CH | TR | BQ | SF | DB | SV |
Search String
| Function | Description | Backends |
|---|
STARTS_WITH() | Returns TRUE if a string starts with a specified prefix. | DD | PG | CH | TR | BQ | SF | DB | SV |
ENDS_WITH() | Returns TRUE if a string ends with a specified suffix. | DD | PG | CH | TR | BQ | SF | DB | SV |
POSITION | Returns the 1-based index of the first occurrence of a substring within a string. | DD | PG | CH | TR | BQ | SF | DB | SV |
STRPOS() | Returns the position of a substring within a string, optionally finding the N-th occurrence. | DD | PG | CH | TR | BQ | SF | DB | SV |
Extraction String
| Function | Description | Backends |
|---|
LEFT() | Returns the first `n` characters of the string (or the full string when `n` is greater than its... | DD | PG | CH | TR | BQ | SF | DB | SV |
RIGHT() | Returns the last `n` characters of the string (or the full string when `n` is greater than its... | DD | PG | CH | TR | BQ | SF | DB | SV |
SUBSTR() | Returns a substring from a string starting at a specified position. | DD | PG | CH | TR | BQ | SF | DB | SV |
SPLIT() | Returns an array of substrings from a string split by a delimiter. | DD | PG | CH | TR | BQ | SF | DB | SV |
SPLIT_PART() | Returns a specific part of a string after splitting by a delimiter. | DD | PG | CH | TR | BQ | SF | DB | SV |
Transformation String
| Function | Description | Backends |
|---|
REVERSE() | Returns the string with all characters in reverse order. | DD | PG | CH | TR | BQ | SF | DB | SV |
REPLACE() | Returns the string with all occurrences of a substring replaced with another substring. | DD | PG | CH | TR | BQ | SF | DB | SV |
FORMAT(...) | Builds a VARCHAR from a C-style format string and one scalar argument per placeholder. | DD | PG | CH | TR | BQ | SF | DB | SV |
TRANSLATE() | Returns a string with character-level replacements applied based on character-to-character mappings. | DD | PG | CH | TR | BQ | SF | DB | SV |
BASE64_ENCODE() | Encodes a string as standard Base64 text. | DD | PG | CH | TR | BQ | SF | DB | SV |
BASE64_DECODE() | Decodes a Base64 string back to plain text. | DD | PG | CH | TR | BQ | SF | DB | SV |
HEX_ENCODE() | Encodes a string as a contiguous hexadecimal string (two hex digits per byte). | DD | PG | CH | TR | BQ | SF | DB | SV |
HEX_DECODE() | Decodes a contiguous hexadecimal string back to plain text. | DD | PG | CH | TR | BQ | SF | DB | SV |
URL_ENCODE() | Encodes a string for safe use in URL components using percent-encoding (RFC 3986). | DD | PG | CH | TR | BQ | SF | DB | SV |
URL_DECODE() | Decodes a percent-encoded string (RFC 3986). | DD | PG | CH | TR | BQ | SF | DB | SV |
Concatenation
| Function | Description | Backends |
|---|
CONCAT(...) | Returns a single concatenated string from a list of strings. | DD | PG | CH | TR | BQ | SF | DB | SV |
|| [concatenation] | Concatenates two strings; chains associate to the left (same underlying `CONCAT_FN` bundle as... | DD | PG | CH | TR | BQ | SF | DB | SV |
CONCAT_WS(...) | Returns a concatenated string from a list of strings with a separator between each element. | DD | PG | CH | TR | BQ | SF | DB | SV |
Character
| Function | Description | Backends |
|---|
LENGTH() | Returns the number of characters in a string. | DD | PG | CH | TR | BQ | SF | DB | SV |
CHR() | Returns the character corresponding to the given Unicode code point. | DD | PG | CH | TR | BQ | SF | DB | SV |
CODEPOINT() | Returns the Unicode code point of a one-character string. | DD | PG | CH | TR | BQ | SF | DB | SV |
Distance
| Function | Description | Backends |
|---|
HAMMING_DISTANCE() | Returns the Hamming distance between two strings of equal length. | DD | PG | CH | TR | BQ | SF | DB | SV |
LEVENSHTEIN_DISTANCE() | Returns the Levenshtein (edit) distance between two strings. | DD | PG | CH | TR | BQ | SF | DB | SV |
Phonetic
| Function | Description | Backends |
|---|
SOUNDEX() | Returns a four-character Soundex code representing the phonetic sound of a string. | DD | PG | CH | TR | BQ | SF | DB | SV |
Hash
| Function | Description | Backends |
|---|
MD5() | Returns the MD5 hash of a string as a 32-character hexadecimal string. | DD | PG | CH | TR | BQ | SF | DB | SV |
SHA1() | Returns the SHA-1 hash of a string as a 40-character hexadecimal string. | DD | PG | CH | TR | BQ | SF | DB | SV |
SHA256() | Returns the SHA-256 hash of a string as a 64-character hexadecimal string. | DD | PG | CH | TR | BQ | SF | DB | SV |
Regex
| Function | Description | Backends |
|---|
REGEX_CONTAINS() | Returns TRUE if the haystack string contains a match for the regular expression pattern (substring... | DD | PG | CH | TR | BQ | SF | DB | SV |
REGEX_MATCH() | Returns TRUE if the entire string matches the regular expression pattern. Unlike REGEX_CONTAINS,... | DD | PG | CH | TR | BQ | SF | DB | SV |
REGEX_EXTRACT_FIRST() | Returns the first substring that matches the pattern, optionally selecting a capture group index (0... | DD | PG | CH | TR | BQ | SF | DB | SV |
REGEX_EXTRACT_ALL() | Returns an array of every non-overlapping substring that matches the pattern, in left-to-right... | DD | PG | CH | TR | BQ | SF | DB | SV |
REGEX_SPLIT() | Splits a string by a regular expression pattern and returns the parts between matches as an array. | DD | PG | CH | TR | BQ | SF | DB | SV |
REGEX_REPLACE_FIRST() | Returns the haystack with the first regular-expression match replaced by the replacement string. | DD | PG | CH | TR | BQ | SF | DB | SV |
REGEX_REPLACE_ALL() | Returns the haystack with every non-overlapping regular-expression match replaced by the... | DD | PG | CH | TR | BQ | SF | DB | SV |
Date And Time
Date/timestamp arithmetic
| Function | Description | Backends |
|---|
ADD() | Returns the timestamp after adding an interval to a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
DATE_ADD() | Returns the date/timestamp after adding a given number of a given units to the given date or... | DD | PG | CH | TR | BQ | SF | DB | SV |
SUBTRACT() | Subtracts an interval from a timestamp or date, or returns the interval between two timestamps or... | DD | PG | CH | TR | BQ | SF | DB | SV |
DATE_SUBTRACT() | Returns the number of complete elapsed units in timestamp1 − timestamp2. Chaining-friendly: the... | DD | PG | CH | TR | BQ | SF | DB | SV |
DATE_DIFF() | Returns the number of calendar boundary crossings in timestamp1 − timestamp2. Same argument order... | DD | PG | CH | TR | BQ | SF | DB | SV |
Calendar queries
| Function | Description | Backends |
|---|
FIRST_DAY_OF() | Returns the first calendar day of the period containing the given date or timestamp: a DATE for a... | DD | PG | CH | TR | BQ | SF | DB | SV |
LAST_DAY_OF() | Returns the last calendar day of the period containing the given date or timestamp: a DATE for a... | DD | PG | CH | TR | BQ | SF | DB | SV |
DAYS_IN() | Returns the number of calendar days in the MONTH, QUARTER, HALF (half-year), or YEAR that contains... | DD | PG | CH | TR | BQ | SF | DB | SV |
Sequence generation
| Function | Description | Backends |
|---|
SEQUENCE() | Generates an inclusive array of dates or timestamps separated by an interval. | DD | PG | CH | TR | BQ | SF | DB | SV |
DATE_SEQUENCE() | Returns an array of timestamps: `count` values beginning at `start`, each separated by `interval`. | DD | PG | CH | TR | BQ | SF | DB | SV |
Extraction
| Function | Description | Backends |
|---|
DATE_PART() | Returns the part of the given timestamp in the given unit. | DD | PG | CH | TR | BQ | SF | DB | SV |
DAY() | Returns the day component of a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
HOUR() | Returns the hour component of a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
MINUTE() | Returns the minute component of a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
MONTH() | Returns the month component of a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
QUARTER() | Returns the quarter component of a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
SECOND() | Returns the second component of a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
WEEK() | Returns the week component of a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
YEAR() | Returns the year component of a date or timestamp. | DD | PG | CH | TR | BQ | SF | DB | SV |
Truncation and formatting
| Function | Description | Backends |
|---|
DATE_TRUNC() | Returns the given date or timestamp truncated to the given unit. | DD | PG | CH | TR | BQ | SF | DB | SV |
DATE_FORMAT() | Returns a string from the given date or timestamp and format. | DD | PG | CH | TR | BQ | SF | DB | SV |
TO_ISO8601() | Returns an ISO 8601 string from the given timestamp or interval. | DD | PG | CH | TR | BQ | SF | DB | SV |
Parsing and construction
| Function | Description | Backends |
|---|
DATE_PARSE() | Returns a timestamp from the given string and format. | DD | PG | CH | TR | BQ | SF | DB | SV |
FROM_ISO8601_TIMESTAMP() | Returns a timestamp from the given ISO 8601 string. | DD | PG | CH | TR | BQ | SF | DB | SV |
MAKE_DATE() | Builds a DATE from its year, month and day, given as three arguments or as a ROW. | DD | PG | CH | TR | BQ | SF | DB | SV |
MAKE_TIMESTAMP() | Builds a TIMESTAMP from its calendar and clock components, given as six arguments or as a ROW. | DD | PG | CH | TR | BQ | SF | DB | SV |
Unix time conversion
| Function | Description | Backends |
|---|
FROM_UNIXTIME() | Returns a timestamp from the given unix timestamp (BIGINT representation of the number of seconds... | DD | PG | CH | TR | BQ | SF | DB | SV |
TO_UNIXTIME() | Returns a unix timestamp (DECIMAL seconds since 1970-01-01 00:00:00 UTC) from the given date or... | DD | PG | CH | TR | BQ | SF | DB | SV |
Timezone conversion
| Function | Description | Backends |
|---|
LOCAL_TO_UTC() | Converts a local clock time (TIMESTAMPTZ) in the given zone to a UTC TIMESTAMP. | DD | PG | CH | TR | BQ | SF | DB | SV |
UTC_TO_LOCAL() | Converts a UTC TIMESTAMP to the local clock time in the given timezone (TIMESTAMPTZ). | DD | PG | CH | TR | BQ | SF | DB | SV |
Interval operations
| Function | Description | Backends |
|---|
MAKE_INTERVAL() | Builds an INTERVAL from a ROW of duration components. | DD | PG | CH | TR | BQ | SF | DB | SV |
FROM_ISO8601_INTERVAL() | Returns an interval from the given ISO 8601 duration string. | DD | PG | CH | TR | BQ | SF | DB | SV |
INTERVAL_PARSE() | Returns an interval from the given duration string. | DD | PG | CH | TR | BQ | SF | DB | SV |
INTERVAL_TO_MS() | Returns the truncated number of milliseconds in the given interval. | DD | PG | CH | TR | BQ | SF | DB | SV |
UNSAFE_NATIVE() | Returns the value an INTERVAL is stored as on the backend, instead of its canonical text. | DD | PG | CH | TR | BQ | SF | DB | SV |
TO_ISO8601() | Returns an ISO 8601 duration string from the given interval. | DD | PG | CH | TR | BQ | SF | DB | SV |
MULTIPLY() | Scales an interval by an integer factor. | DD | PG | CH | TR | BQ | SF | DB | SV |
Json
| Function | Description | Backends |
|---|
JSON_PARSE() | Returns the given string as a JSON expression. | DD | PG | CH | TR | BQ | SF | DB | SV |
JSON_PARSE_AS() | Returns the value of a JSON expression represented as a string in the given type. | DD | PG | CH | TR | BQ | SF | DB | SV |
JSON_EXTRACT() | Returns the value of the given JSON path in the given JSON expression. | DD | PG | CH | TR | BQ | SF | DB | SV |
JSON_EXTRACT_SCALAR() | Returns the scalar value of the given JSON path in the given JSON expression. | DD | PG | CH | TR | BQ | SF | DB | SV |
JSON_FORMAT() | Returns the given JSON expression as a string. | DD | PG | CH | TR | BQ | SF | DB | SV |
JSON_ARRAY_COUNT() | Returns the number of elements in a JSON array. | DD | PG | CH | TR | BQ | SF | DB | SV |
JSON_KEYS() | Returns the keys of a JSON object as an array of strings. | DD | PG | CH | TR | BQ | SF | DB | SV |
JSON_TYPE() | Returns the type of a JSON value as a string. | DD | PG | CH | TR | BQ | SF | DB | SV |
Array
Element Access
| Function | Description | Backends |
|---|
ELEMENT_AT_POS() | Returns the element at the specified position in an array. | DD | PG | CH | TR | BQ | SF | DB | SV |
ELEMENTS_AT_POS() | Returns the elements at multiple specified positions in an array. | DD | PG | CH | TR | BQ | SF | DB | SV |
SLICE_LEN() | Returns a slice of an array using start:length:step semantics. | DD | PG | CH | TR | BQ | SF | DB | SV |
SLICE_END() | Returns the slice of an array or a string from a start index to an end index (inclusive). | DD | PG | CH | TR | BQ | SF | DB | SV |
Search And Lookup
| Function | Description | Backends |
|---|
CONTAINS() | Returns TRUE if the array contains the specified element. | DD | PG | CH | TR | BQ | SF | DB | SV |
CONTAINS_SEQUENCE() | Returns TRUE if the array contains the specified sequence as a contiguous subsequence. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_POSITION() | Returns the 1-based position of the first occurrence of an element in an array. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_LOOKUP(...) | Returns the value corresponding to a lookup key using parallel key-value arrays. | DD | PG | CH | TR | BQ | SF | DB | SV |
Filtering And Transformation
| Function | Description | Backends |
|---|
ARRAY_SORT() | Returns the sorted version of an array. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_REVERSE() | Returns the reverse of an array. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_ENUMERATE() | Returns an array of rows pairing each 1-based position with the corresponding element. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_ENUMERATE_FLATTEN() | Returns an array of rows pairing each 1-based position with the flattened fields of the... | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_ROTATE() | Returns a new array whose elements are rotated circularly; positive amounts shift left, negative... | DD | PG | CH | TR | BQ | SF | DB | SV |
NGRAMS() | Returns adjacent n-element sub-sequences (n-grams) sliding across the input array. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_DISTINCT() | Returns an array with distinct elements, in order of first occurrence. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_REMOVE() | Returns an array with all occurrences of the specified element removed. | DD | PG | CH | TR | BQ | SF | DB | SV |
FLATTEN() | Flattens a nested array structure into a single-level array. | DD | PG | CH | TR | BQ | SF | DB | SV |
Set Operations
| Function | Description | Backends |
|---|
ARRAY_UNION() | Returns the union of two arrays, keeping the first occurrence of each element. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_INTERSECT() | Returns the intersection of two arrays using set semantics. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_EXCEPT() | Returns the difference of two arrays using set semantics. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAYS_OVERLAP() | Returns TRUE if any elements are common between the two arrays. | DD | PG | CH | TR | BQ | SF | DB | SV |
Aggregation And Statistics
| Function | Description | Backends |
|---|
ARRAY_COUNT() | Returns the number of elements in an array. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_SUM() | Returns the sum of all numeric elements in an array. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_PRODUCT() | Returns the product of all numeric elements in an array as a DOUBLE. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_MEDIAN() | Returns the statistical median of numeric array elements as a DOUBLE. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_STDDEV_POP() | Returns the population standard deviation (divide by N) of numeric array elements as a DOUBLE. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_STDDEV_SAMP() | Returns the sample standard deviation (divide by N-1) of numeric array elements as a DOUBLE. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_VAR_POP() | Returns the population variance (divide by N) of numeric array elements as a DOUBLE. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_VAR_SAMP() | Returns the sample variance (divide by N-1) of numeric array elements as a DOUBLE. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_AVG() | Returns the arithmetic mean (average) of all numeric elements in an array. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_MIN() | Returns the smallest value in an array using natural ordering. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_MAX() | Returns the largest value in an array using natural ordering. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_HISTOGRAM() | Returns a frequency histogram of values in an array as an array of value-count pairs. | DD | PG | CH | TR | BQ | SF | DB | SV |
Boolean Operations
| Function | Description | Backends |
|---|
ALL(...) | Returns TRUE if all elements in the boolean array are true. | DD | PG | CH | TR | BQ | SF | DB | SV |
ANY(...) | Returns TRUE if any element in the boolean array is true. | DD | PG | CH | TR | BQ | SF | DB | SV |
NONE(...) | Returns TRUE if no elements in the boolean array are true. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_NOT() | Returns an array with inverted boolean values (logical NOT applied to each element). | DD | PG | CH | TR | BQ | SF | DB | SV |
Array Combination
| Function | Description | Backends |
|---|
ARRAY_CONCAT(...) | Concatenates multiple arrays into a single combined array with optional deduplication. | DD | PG | CH | TR | BQ | SF | DB | SV |
COMBINATIONS() | Returns all 2-element sub-groups of the input array as an array of 2-element arrays. | DD | PG | CH | TR | BQ | SF | DB | SV |
PERMUTATIONS() | Returns all ordered 2-element selections from the input array as an array of 2-element arrays. | DD | PG | CH | TR | BQ | SF | DB | SV |
Array Generation
| Function | Description | Backends |
|---|
REPEAT() | Creates an array by repeating an element a specified number of times. | DD | PG | CH | TR | BQ | SF | DB | SV |
SEQUENCE() | Generates an inclusive array from start to stop. Accepts integers with an optional step (default... | DD | PG | CH | TR | BQ | SF | DB | SV |
String Conversion
| Function | Description | Backends |
|---|
ARRAY_JOIN() | Joins the elements of an array into a single string using a specified delimiter. | DD | PG | CH | TR | BQ | SF | DB | SV |
Vector Operations
| Function | Description | Backends |
|---|
COSINE_SIMILARITY() | Calculates the cosine similarity between two arrays. | DD | PG | CH | TR | BQ | SF | DB | SV |
DOT_PRODUCT() | Calculates the dot product of two arrays. | DD | PG | CH | TR | BQ | SF | DB | SV |
EUCLIDEAN_DISTANCE() | Calculates the Euclidean distance between two arrays. | DD | PG | CH | TR | BQ | SF | DB | SV |
NORMALIZE() | Normalizes a numeric array by dividing each element by the sum of all elements. | DD | PG | CH | TR | BQ | SF | DB | SV |
Row
| Function | Description | Backends |
|---|
MERGE(...) | Merges multiple row structures into a single row with combined fields | DD | PG | CH | TR | BQ | SF | DB | SV |
Array Of Rows
Indexing
| Function | Description | Backends |
|---|
INDEX_UNIQUE() | Returns an index unique computed from the given array and key. | DD | PG | CH | TR | BQ | SF | DB | SV |
INDEX_MULTI() | Returns an index multi computed from the given array and key. | DD | PG | CH | TR | BQ | SF | DB | SV |
ELEMENT_AT_KEY() | Returns one element at the given key from the given index, array or array of rows. | DD | PG | CH | TR | BQ | SF | DB | SV |
ELEMENTS_AT_KEY() | Returns multiple elements at the given key from the given index, array or array of rows. | DD | PG | CH | TR | BQ | SF | DB | SV |
Other
| Function | Description | Backends |
|---|
EXTRACT(...) | Returns the extracted fields from the given expression. | DD | PG | CH | TR | BQ | SF | DB | SV |
UNWRAP() | Returns the first field values from an array of single-field rows as a simple array. | DD | PG | CH | TR | BQ | SF | DB | SV |
UNWRAP_ONE() | Returns the value of the first field of the first element in an array of single-field rows. | DD | PG | CH | TR | BQ | SF | DB | SV |
ZIP(...) | Combines multiple arrays into a single array of structured rows with named fields. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_MERGE(...) | Merges multiple arrays of rows element-wise into a single array of combined rows, with optional... | DD | PG | CH | TR | BQ | SF | DB | SV |
CARRY(...) | Carries one or more scalar values into each row of an array of rows, adding them as new fields | DD | PG | CH | TR | BQ | SF | DB | SV |
EXTEND(...) | Adds computed feature fields to a base row or array of rows with field bindings | DD | PG | CH | TR | BQ | SF | DB | SV |
TRANSFORM | Transforms an array of rows using a subquery with optional METHOD | DD | PG | CH | TR | BQ | SF | DB | SV |
RECURSE(...) | Produces an array of rows by iterating a seed ROW, optionally traversing entity relationships | DD | PG | CH | TR | BQ | SF | DB | SV |
Group By
Numeric
Counting
Boolean
Collection
Statistical
Window Function
Numeric
| Function | Description | Backends |
|---|
SUM() OVER ... | Returns the sum of values in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
AVG() OVER ... | Returns the average of values in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
MIN() OVER ... | Returns the minimum value in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
MAX() OVER ... | Returns the maximum value in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
PRODUCT() OVER ... | Returns the product of values in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
BIT_AND() OVER ... | Returns the bitwise AND of integer values in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
BIT_OR() OVER ... | Returns the bitwise OR of integer values in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
BIT_XOR() OVER ... | Returns the bitwise XOR of integer values in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
Counting
| Function | Description | Backends |
|---|
COUNT() OVER ... | Returns the count of rows in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
COUNT_IF() OVER ... | Returns the count of rows where the condition is true in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
APPROX_DISTINCT() OVER ... | Returns the approximate number of distinct values in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
Boolean
| Function | Description | Backends |
|---|
BOOL_AND() OVER ... | Returns TRUE if all boolean values in the window frame are true. | DD | PG | CH | TR | BQ | SF | DB | SV |
BOOL_OR() OVER ... | Returns TRUE if any boolean value in the window frame is true. | DD | PG | CH | TR | BQ | SF | DB | SV |
Numbering
| Function | Description | Backends |
|---|
ROW_NUMBER() OVER ... | Returns a unique sequential number for each row within its partition, starting at 1. | DD | PG | CH | TR | BQ | SF | DB | SV |
RANK() OVER ... | Returns the rank of the current row within its partition, with gaps. Rows with equal values for the... | DD | PG | CH | TR | BQ | SF | DB | SV |
DENSE_RANK() OVER ... | Returns the rank of the current row within its partition, without gaps. Similar to RANK but... | DD | PG | CH | TR | BQ | SF | DB | SV |
NTILE() OVER ... | Returns the bucket number (1 to n) for each row in a partition, where n is the number of buckets. | DD | PG | CH | TR | BQ | SF | DB | SV |
PERCENT_RANK() OVER ... | Returns the relative rank of the current row: (rank - 1) / (total rows - 1). | DD | PG | CH | TR | BQ | SF | DB | SV |
CUME_DIST() OVER ... | Returns the cumulative distribution: (number of rows <= current row) / (total rows). | DD | PG | CH | TR | BQ | SF | DB | SV |
Offset
| Function | Description | Backends |
|---|
LEAD() OVER ... | Returns the value from the row that leads (follows) the current row by a specified offset within... | DD | PG | CH | TR | BQ | SF | DB | SV |
LAG() OVER ... | Returns the value from the row that lags (precedes) the current row by a specified offset within... | DD | PG | CH | TR | BQ | SF | DB | SV |
FIRST_VALUE() OVER ... | Returns the first value in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
LAST_VALUE() OVER ... | Returns the last value in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
NTH_VALUE() OVER ... | Returns the value at the nth row of the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
Collection
| Function | Description | Backends |
|---|
ANY_VALUE() OVER ... | Returns a non-null value of the window frame: the minimum in value order, NULL if there is none. | DD | PG | CH | TR | BQ | SF | DB | SV |
ARRAY_AGG() OVER ... | Returns an array of all values in the window frame. | DD | PG | CH | TR | BQ | SF | DB | SV |
MIN_BY() OVER ... | Returns the value of the first expression corresponding to the minimum value of the second... | DD | PG | CH | TR | BQ | SF | DB | SV |
MAX_BY() OVER ... | Returns the value of the first expression corresponding to the maximum value of the second... | DD | PG | CH | TR | BQ | SF | DB | SV |
STRING_AGG() OVER ... | Concatenates string values in the window frame in order up to the current row, separated by the... | DD | PG | CH | TR | BQ | SF | DB | SV |
Statistical
Business
Time Travel
| Function | Description | Backends |
|---|
ROW_AT_TIME() | Returns the row of a history (slowly changing dimension) in effect at the given point in time. | DD | PG | CH | TR | BQ | SF | DB | SV |
ROWS_AT_TIME() | Returns the rows of a history alive at the given point in time. | DD | PG | CH | TR | BQ | SF | DB | SV |
Growth Accounting
| Function | Description | Backends |
|---|
TO_ACTIVITY_BITS() | Returns the activity bits for the given array of activity dates and date reference. | DD | PG | CH | TR | BQ | SF | DB | SV |
FROM_ACTIVITY_BITS() | Returns the activity dates for the given activity bits and date reference. | DD | PG | CH | TR | BQ | SF | DB | SV |
BINARY_REPRESENTATION() | Returns the binary representation as a string of the given activity bits | DD | PG | CH | TR | BQ | SF | DB | SV |
UPDATE_ACTIVITY_BIT() | Returns the activity bits for the given activity bits and whether the current day is active. | DD | PG | CH | TR | BQ | SF | DB | SV |
IS_ACTIVE() | Returns whether the given activity bits is active for the given time period | DD | PG | CH | TR | BQ | SF | DB | SV |
ACTIVITY_STATUS() | Returns the activity status between two time periods for the given activity bits | DD | PG | CH | TR | BQ | SF | DB | SV |
COUNT_ACTIVE() | Returns the number of active days for the given activity bits and time period | DD | PG | CH | TR | BQ | SF | DB | SV |
RECENCY() | Returns the number of days since the last active day for the given activity bits | DD | PG | CH | TR | BQ | SF | DB | SV |
Experimentation
| Function | Description | Backends |
|---|
HASH01() | Returns a value between 0 and 1 based on the given hashing key. | DD | PG | CH | TR | BQ | SF | DB | SV |
GRADUAL_ROLLOUT() | Returns the exposure to a new version based on the given hashing key and rollout parameters. | DD | PG | CH | TR | BQ | SF | DB | SV |
Simulations
| Function | Description | Backends |
|---|
SAMPLE_UNIFORM() | Returns a value uniformly chosen between two bounds based on the given hashing key. | DD | PG | CH | TR | BQ | SF | DB | SV |
SAMPLE_GAUSSIAN() | Returns a value chosen from a normal distribution between two bounds based on the given hashing key. | DD | PG | CH | TR | BQ | SF | DB | SV |
SAMPLE_VALUE(...) | Returns a value from the given array of values and proportions based on the given hashing key. | DD | PG | CH | TR | BQ | SF | DB | SV |
SAMPLE_BOOL() | Returns the discrete event (true or false) with the given probability based on the given hashing... | DD | PG | CH | TR | BQ | SF | DB | SV |
SAMPLE_EXPONENTIAL() | Returns a value drawn from an exponential distribution with the given rate, based on the given... | DD | PG | CH | TR | BQ | SF | DB | SV |
SAMPLE_POISSON() | Returns an integer drawn from a Poisson distribution with the given rate, based on the given... | DD | PG | CH | TR | BQ | SF | DB | SV |
SAMPLE_LOGNORMAL() | Returns a value drawn from a log-normal distribution, clamped to [lower, upper], based on the given... | DD | PG | CH | TR | BQ | SF | DB | SV |
SAMPLE_GEOMETRIC() | Returns the number of trials until first success, drawn from a geometric distribution, based on the... | DD | PG | CH | TR | BQ | SF | DB | SV |
SAMPLE_WEIBULL() | Returns a value drawn from a Weibull distribution based on the given hashing key. | DD | PG | CH | TR | BQ | SF | DB | SV |
| Function | Description | Backends |
|---|
KEYSET() | Returns a reference to a keyset. | DD | PG | CH | TR | BQ | SF | DB | SV |
KEYSET_GROUP() | Defines an ordered set of interchangeable keysets. | DD | PG | CH | TR | BQ | SF | DB | SV |
PREPARED_STATEMENT() | Returns a reference to a prepared statement of the given feature with the given inputs. | DD | PG | CH | TR | BQ | SF | DB | SV |
LOGGER() | Logs the calls of a prepared statement to a sink, row by row, after each response is sent. | DD | PG | CH | TR | BQ | SF | DB | SV |
SINK() | Where a LOGGER or a HOOK writes: the scheme of the DSN names the product. Loggers write cold sinks... | DD | PG | CH | TR | BQ | SF | DB | SV |
HOOK() | Runs a prepared statement on each record of a stream, or after each hook run of a prepared... | DD | PG | CH | TR | BQ | SF | DB | SV |
TYPEOF() | Returns the type of the given expression in FeatureQL. | DD | PG | CH | TR | BQ | SF | DB | SV |
DESCRIBE() | Returns catalog and type metadata for an expression as a typed ROW. | DD | PG | CH | TR | BQ | SF | DB | SV |
SQLTYPEOF() | Returns the name of the translated storage type for the expression (after FeatureQL is lowered for... | DD | PG | CH | TR | BQ | SF | DB | SV |
VERSION() | Returns registry version; reload time is set only on a dev workstation. | DD | PG | CH | TR | BQ | SF | DB | SV |
SQLVERSION() | Returns the active SQL dialect name and the backend database version. | DD | PG | CH | TR | BQ | SF | DB | SV |
Non Deterministic
| Function | Description | Backends |
|---|
CURRENT_TIMESTAMP() | Returns the current date and time. | DD | PG | CH | TR | BQ | SF | DB | SV |
RANDOM() | Returns a random number in the range 0.0 <= x < 1.0 | DD | PG | CH | TR | BQ | SF | DB | SV |
Other
| Function | Description | Backends |
|---|
EVAL_CONST() | Returns the result of evaluating a constant formula as a literal. | DD | PG | CH | TR | BQ | SF | DB | SV |
Geospatial
Constructor
| Function | Description | Backends |
|---|
ST_GEOMPOINT() | Creates a GEOMETRY point from x and y coordinates. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_GEOGPOINT() | Creates a GEOGRAPHY point from longitude and latitude coordinates in WGS84. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_GEOMFROMTEXT() | Creates a GEOMETRY value from a WKT (Well Known Text) string. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_GEOGFROMTEXT() | Creates a GEOGRAPHY value from a WKT (Well Known Text) string. Coordinates are interpreted as... | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_MAKELINE() | Creates a LINESTRING from two geometry or geography inputs. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_MAKEPOLYGON() | Creates a POLYGON from a closed LineString shell. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_COLLECT() | Combines two geometries or geographies into a collection without dissolving boundaries. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_GEOMFROMWKB() | Creates a GEOMETRY value from a WKB (Well Known Binary) byte string. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_GEOGFROMWKB() | Creates a GEOGRAPHY value from a WKB (Well Known Binary) byte string. Coordinates are interpreted... | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_GEOMFROMGEOJSON() | Creates a GEOMETRY value from a GeoJSON string. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_GEOGFROMGEOJSON() | Creates a GEOGRAPHY value from a GeoJSON string. Coordinates are interpreted as lon/lat in WGS84. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_TOGEOGRAPHY() | Casts a GEOMETRY to GEOGRAPHY, reinterpreting coordinates as lon/lat in WGS84 without reprojection. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_TOGEOMETRY() | Casts a GEOGRAPHY to GEOMETRY, reinterpreting the WGS84 lon/lat coordinates as planar x/y without... | DD | PG | CH | TR | BQ | SF | DB | SV |
Serialization
| Function | Description | Backends |
|---|
ST_ASTEXT() | Returns the WKT (Well Known Text) representation of a geometry or geography. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ASGEOJSON() | Returns the GeoJSON representation of a geometry or geography. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ASWKB() | Returns the WKB (Well Known Binary) representation of a geometry or geography. | DD | PG | CH | TR | BQ | SF | DB | SV |
Measurement
| Function | Description | Backends |
|---|
ST_DISTANCE() | Returns the minimum distance between two geometries or geographies. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_AREA() | Returns the area of a geometry or geography. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_LENGTH() | Returns the length of a linear geometry or geography. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_PERIMETER() | Returns the perimeter of an areal geometry or geography. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_AZIMUTH() | Returns the azimuth angle in radians from point A to point B, measured clockwise from north... | DD | PG | CH | TR | BQ | SF | DB | SV |
Predicate
| Function | Description | Backends |
|---|
ST_INTERSECTS() | Returns TRUE if two geometries or geographies share any portion of space. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_CONTAINS() | Returns TRUE if geometry/geography A fully contains geometry/geography B. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_WITHIN() | Returns TRUE if geometry/geography A is fully within geometry/geography B. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_DWITHIN() | Returns TRUE if the distance between two geometries or geographies is less than or equal to a... | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_EQUALS() | Returns TRUE if two geometries or geographies represent the same point set. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_DISJOINT() | Returns TRUE if two geometries or geographies do not share any space. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_TOUCHES() | Returns TRUE if two geometries share boundary points but no interior points. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_CROSSES() | Returns TRUE if two geometries have some but not all interior points in common. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_OVERLAPS() | Returns TRUE if two geometries of the same dimension have overlapping interiors. | DD | PG | CH | TR | BQ | SF | DB | SV |
Accessor
| Function | Description | Backends |
|---|
ST_X() | Returns the X coordinate of a point (or longitude for geography). | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_Y() | Returns the Y coordinate of a point (or latitude for geography). | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_GEOMETRYTYPE() | Returns the OGC type name of a geometry or geography as a string. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_NUMPOINTS() | Returns the total number of vertices in a geometry or geography. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_NUMGEOMETRIES() | Returns the number of sub geometries in a collection, or 1 for singular geometries. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_DIMENSION() | Returns the topological dimension of a geometry or geography. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ISEMPTY() | Returns TRUE if a geometry or geography is empty. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ISVALID() | Returns TRUE if a geometry is topologically valid (no self intersections, proper ring closure,... | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_SRID() | Returns the SRID (Spatial Reference ID) of a geometry. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ISCLOSED() | Returns TRUE if a geometry is closed (start point equals end point for lines; always TRUE for... | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_STARTPOINT() | Returns the first vertex of a LineString. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ENDPOINT() | Returns the last vertex of a LineString. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ISSIMPLE() | Returns TRUE if a geometry has no anomalous geometric points such as self-intersections or... | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_GEOMPOINTN() | Returns the Nth vertex of a LineString (1-indexed). | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ISPOINT() | Returns TRUE if the geometry or geography is a Point. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_EXTERIORRING() | Returns the outer ring of a Polygon as a LineString. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ISLINE() | Returns TRUE if the geometry or geography is a LineString. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ISPOLYGON() | Returns TRUE if the geometry or geography is a Polygon. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_NUMINTERIORRINGS() | Returns the number of interior rings (holes) in a Polygon. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_INTERIORRINGN() | Returns the Nth interior ring (hole) of a Polygon as a LineString (1-indexed). | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ISCOLLECTION() | Returns TRUE if the geometry or geography is a Multi* or GeometryCollection. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_GEOMETRYN() | Returns the Nth sub-geometry from a geometry collection (1-indexed). | DD | PG | CH | TR | BQ | SF | DB | SV |
Transformation
| Function | Description | Backends |
|---|
ST_CENTROID() | Returns the geometric center of mass (centroid) of a geometry. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_BUFFER() | Returns a geometry that represents all points within a given distance of the input. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_ENVELOPE() | Returns the bounding box of a geometry as a polygon. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_CONVEXHULL() | Returns the convex hull of a geometry. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_SIMPLIFY() | Returns a simplified version of a geometry using the Douglas Peucker algorithm. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_INTERSECTION() | Returns the geometry/geography representing the point set intersection of two inputs. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_UNION() | Returns the geometry/geography representing the point set union of two inputs. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_DIFFERENCE() | Returns the geometry/geography representing the point set difference of A minus B. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_SYMDIFFERENCE() | Returns the geometry representing the point set symmetric difference of two inputs (union minus... | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_REVERSE() | Returns a geometry with the vertex order of each component reversed. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_SNAP_TO_GRID() | Snaps all vertices of a geometry to a uniform grid with the given cell size. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_SETSRID() | Sets the SRID on a geometry without modifying or reprojecting coordinates. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_TRANSFORM() | Reprojects a geometry from its current SRID to a target SRID. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_DUMP() | Explodes a Multi* or GeometryCollection into an array of its component geometries. | DD | PG | CH | TR | BQ | SF | DB | SV |
Aggregation
| Function | Description | Backends |
|---|
ST_UNION_AGG() | Aggregate function that dissolves all geometries in a group into a single geometry. | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_COLLECT_AGG() | Aggregate function that collects all geometries in a group into a single GeometryCollection without... | DD | PG | CH | TR | BQ | SF | DB | SV |
ST_EXTENT() | Aggregate function that returns the bounding box of all geometries in a group as a polygon. | DD | PG | CH | TR | BQ | SF | DB | SV |
Summary
Showing 432 of 427 functions across 19 of 19 categories.