> ## Documentation Index
> Fetch the complete documentation index at: https://docs.goldsky.com/llms.txt
> Use this file to discover all available pages before exploring further.

# System functions

Mirror pipelines use Flink SQL 1.19. The following tables list the built‑in
functions available in this SQL dialect. For full usage details see the
[Flink documentation](https://nightlies.apache.org/flink/flink-docs-release-1.19/docs/dev/table/functions/systemfunctions/).

## Aggregate functions

* **ANY\_VALUE**: Returns an arbitrary expression value from each group
* **APPROX\_COUNT\_DISTINCT**: Approximates the number of distinct input values
* **ARRAY\_AGG**: Aggregates values into an array
* **AVG**: Computes the average value
* **BIT\_AND**: Computes bitwise AND across numeric values
* **BIT\_OR**: Computes bitwise OR across numeric values
* **BIT\_XOR**: Computes bitwise XOR across numeric values
* **BOOL\_AND**: True if all boolean inputs are TRUE
* **BOOL\_OR**: True if any boolean input is TRUE
* **COLLECT**: Aggregates values into a multiset
* **COLLECT\_LIST**: Aggregates values into a list preserving duplicates
* **COLLECT\_SET**: Aggregates values into a set of distinct entries
* **COUNT**: Counts the number of input rows
* **COVAR\_POP**: Population covariance
* **COVAR\_SAMP**: Sample covariance
* **CUME\_DIST**: Cumulative distribution value
* **DENSE\_RANK**: Calculates rank without gaps
* **FIRST\_VALUE**: Returns the first value in an ordered group
* **GROUPING**: Indicates if a column is aggregated
* **KURTOSIS**: Kurtosis of a numeric distribution
* **LAST\_VALUE**: Returns the last value in an ordered group
* **MAX**: Maximum value
* **MIN**: Minimum value
* **PERCENTILE\_CONT**: Continuous percentile of numeric values
* **PERCENTILE\_DISC**: Discrete percentile of numeric values
* **RANK**: Calculates rank with gaps
* **STDDEV**: Sample standard deviation
* **STDDEV\_POP**: Population standard deviation
* **STDDEV\_SAMP**: Sample standard deviation
* **SUM**: Sum of numeric values
* **VAR\_POP**: Population variance
* **VAR\_SAMP**: Sample variance
* **VARIANCE**: Alias for sample variance

## Collection functions

* **ARRAY**: Constructs an array from the given elements
* **ARRAY\_APPEND**: Appends an element to an array
* **ARRAY\_CONCAT**: Concatenates two arrays
* **ARRAY\_DISTINCT**: Removes duplicate elements from an array
* **ARRAY\_EXCEPT**: Elements of first array not in second
* **ARRAY\_LENGTH**: Returns the length of an array
* **ARRAY\_MAX**: Maximum element of an array
* **ARRAY\_MIN**: Minimum element of an array
* **ARRAY\_POSITION**: Position of an element in an array
* **ARRAY\_PREPEND**: Prepends an element to an array
* **ARRAY\_REMOVE**: Removes all occurrences of an element from an array
* **ARRAY\_REPEAT**: Creates an array filled with repetitions of an element
* **ARRAY\_SLICE**: Sub-array defined by start and end
* **ARRAY\_SORT**: Sorts the elements of an array
* **ARRAY\_UNION**: Union of two arrays
* **CARDINALITY**: Number of elements in a collection
* **ELEMENT**: Returns the element from a single-element collection
* **MAP**: Constructs a map from key/value pairs
* **MAP\_FROM\_ARRAYS**: Creates a map from two arrays
* **MAP\_KEYS**: Returns an array of map keys
* **MAP\_VALUES**: Returns an array of map values
* **MULTISET**: Constructs a multiset
* **SLICE**: Returns a portion of an array or string

## Conditional functions

* **COALESCE**: Returns the first non-null argument
* **DECODE**: Compares a value against a set of cases
* **IF**: Returns one value if condition true else another
* **IFNULL**: Returns second argument if first is NULL
* **IFF**: Synonym for IF
* **ISFALSE**: TRUE if expression is FALSE
* **ISNOTFALSE**: TRUE if expression is not FALSE
* **ISNOTTRUE**: TRUE if expression is not TRUE
* **ISTRUE**: TRUE if expression is TRUE
* **LEAST**: Returns the smallest of the arguments
* **GREATEST**: Returns the largest of the arguments
* **NULLIF**: Returns NULL if arguments are equal
* **NVL**: Synonym for IFNULL
* **NVL2**: Chooses between two values depending on NULL status

## Date and time functions

* **ADDDATE**: Adds days to a date
* **ADD\_MONTHS**: Adds months to a date
* **CURRENT\_DATE**: Current date
* **CURRENT\_TIME**: Current time
* **CURRENT\_TIMESTAMP**: Current timestamp
* **CURRENT\_ROW\_TIMESTAMP**: Timestamp of the current row event time
* **CURDATE**: Synonym for CURRENT\_DATE
* **CURTIME**: Synonym for CURRENT\_TIME
* **DATEADD**: Adds an interval to a date or timestamp
* **DATEDIFF**: Difference between two dates
* **DATE\_FORMAT**: Formats date/time as string
* **DATE\_PART**: Extracts part of a date/time
* **DATE\_SUB**: Subtracts days from a date
* **DAYNAME**: Name of the weekday
* **DAYOFMONTH**: Day of month (1-31)
* **DAYOFWEEK**: Day of week (1-7)
* **DAYOFYEAR**: Day of year (1-366)
* **EXTRACT**: Extracts fields from date/time
* **FROM\_UNIXTIME**: Converts UNIX timestamp to timestamp
* **HOUR**: Extracts hour field
* **LAST\_DAY**: Last day of the month
* **LOCALTIME**: Current local time
* **LOCALTIMESTAMP**: Current local timestamp
* **MAKEDATE**: Creates a date from year and day of year
* **MAKETIME**: Creates a time from hour, minute, second
* **MINUTE**: Extracts minute field
* **MONTH**: Extracts month field
* **MONTHNAME**: Name of the month
* **NEXT\_DAY**: Next weekday after a date
* **NOW**: Current timestamp
* **QUARTER**: Quarter of the year
* **SECOND**: Extracts second field
* **TIMESTAMPADD**: Adds interval to timestamp
* **TIMESTAMPDIFF**: Difference between timestamps
* **TO\_DATE**: Converts string to date
* **TO\_TIMESTAMP**: Converts string or numeric to timestamp
* **TO\_TIMESTAMP\_LTZ**: Converts numeric to timestamp with local time zone
* **TO\_UNIXTIME**: Converts timestamp to UNIX time
* **UNIX\_DATE**: Number of days since UNIX epoch
* **UNIX\_MICROS**: Number of microseconds since UNIX epoch
* **UNIX\_MILLIS**: Number of milliseconds since UNIX epoch
* **UNIX\_SECONDS**: Number of seconds since UNIX epoch
* **UNIX\_TIMESTAMP**: UNIX time of a timestamp or now
* **WEEK**: Week number of year
* **WEEKDAY**: Weekday index (0=Monday)
* **YEAR**: Year field of date
* **YEARWEEK**: Year and week number

## Hash functions

* **MD5**: MD5 hash of a string
* **SHA1**: SHA‑1 hash of a string
* **SHA224**: SHA‑224 hash of a string
* **SHA256**: SHA‑256 hash of a string
* **SHA384**: SHA‑384 hash of a string
* **SHA512**: SHA‑512 hash of a string

## JSON functions

* **JSON\_ARRAY**: Creates a JSON array
* **JSON\_EXISTS**: Checks for existence of JSON path
* **JSON\_OBJECT**: Creates a JSON object
* **JSON\_QUERY**: Extracts JSON fragment
* **JSON\_STRING**: Converts value to JSON string
* **JSON\_VALUE**: Extracts a scalar JSON value

## Math functions

* **ABS**: Absolute value
* **ACOS**: Arc cosine
* **ASIN**: Arc sine
* **ATAN**: Arc tangent
* **ATAN2**: Arc tangent of two numbers
* **CBRT**: Cube root
* **CEIL**: Smallest integer not less than argument
* **COS**: Cosine
* **COSH**: Hyperbolic cosine
* **COT**: Cotangent
* **DEGREES**: Converts radians to degrees
* **EXP**: Exponential function
* **FLOOR**: Largest integer not greater than argument
* **LN**: Natural logarithm
* **LOG**: Logarithm with arbitrary base
* **LOG10**: Base‑10 logarithm
* **LOG2**: Base‑2 logarithm
* **MOD**: Remainder of division
* **PI**: Mathematical constant pi
* **POW**: Raises a number to a power
* **POWER**: Raises a number to a power
* **RADIANS**: Converts degrees to radians
* **RAND**: Random number
* **ROUND**: Rounds to nearest integer or decimal
* **SIGN**: Sign of the number
* **SIN**: Sine
* **SINH**: Hyperbolic sine
* **SQRT**: Square root
* **TAN**: Tangent
* **TANH**: Hyperbolic tangent

## String functions

* **ASCII**: ASCII code of the first character
* **BASE64\_DECODE**: Decodes a base64 string
* **BASE64\_ENCODE**: Encodes data to base64
* **BTRIM**: Trims characters from both ends
* **CHAR**: Character for ASCII code
* **CHAR\_LENGTH**: Number of characters in string
* **CHARACTER\_LENGTH**: Number of characters in string
* **CHR**: Character for Unicode code point
* **CONCAT**: Concatenates strings
* **CONCAT\_WS**: Concatenates strings with separator
* **INITCAP**: Converts to title case
* **LEFT**: Leftmost characters
* **LENGTH**: Length of string in characters
* **LOWER**: Converts to lowercase
* **LPAD**: Left‑pads a string
* **LTRIM**: Trims leading characters
* **OVERLAY**: Replaces substring with new text
* **POSITION**: Position of substring
* **REGEXP\_EXTRACT**: Extracts substring by regular expression
* **REGEXP\_REPLACE**: Replaces substring by regular expression
* **REPEAT**: Repeats the string
* **REPLACE**: Replaces occurrences of substring
* **REVERSE**: Reverses the string
* **RIGHT**: Rightmost characters
* **RPAD**: Right‑pads a string
* **RTRIM**: Trims trailing characters
* **SPLIT**: Splits string into array
* **SPLIT\_INDEX**: Gets element by index after splitting
* **STR\_TO\_MAP**: Converts string to map
* **SUBSTR**: Extracts substring
* **SUBSTRING**: Extracts substring
* **TO\_BASE64**: Encodes to base64
* **TO\_CHAR**: Converts number or timestamp to string
* **TO\_HEX**: Converts value to hexadecimal
* **TRIM**: Trims leading and trailing characters
* **UPPER**: Converts to uppercase

## Type conversion functions

* **BIN**: Converts number to binary string
* **CAST**: Converts a value to a different type
* **CONVERT**: Converts a value to a different type
* **HEX**: Converts number to hexadecimal string
* **TRY\_CAST**: Attempts to cast and returns NULL if it fails
* **UUID**: Generates a random UUID

## Window functions

* **HOP\_END**: End timestamp of a hopping window
* **HOP\_START**: Start timestamp of a hopping window
* **SESSION\_END**: End timestamp of a session window
* **SESSION\_START**: Start timestamp of a session window
* **TUMBLE\_END**: End timestamp of a tumbling window
* **TUMBLE\_START**: Start timestamp of a tumbling window
* **WINDOW\_END**: End timestamp of a generic window
* **WINDOW\_START**: Start timestamp of a generic window

## Other functions

* **CURRENT\_CATALOG**: Name of the current catalog
* **CURRENT\_DATABASE**: Name of the current database
* **CURRENT\_SCHEMA**: Name of the current schema
* **CURRENT\_USER**: Name of the current user
* **DATABASE**: Synonym for CURRENT\_DATABASE
* **SESSION\_USER**: Name of the session user
* **SYSTEM\_USER**: Name of the system user
* **VERSION**: Returns the Flink version
