Skip to main content

abs

Returns the absolute value of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

acos

Returns the arc cosine of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

array_agg

Returns an array created from the input x elements. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

array_distinct

Remove duplicate values from the array x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

array_except

Returns an array of elements in x but not in y, without duplicates. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

array_intersect

Returns an array of the elements in the intersection of x and y, without duplicates. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

array_join

Concatenates the elements of the given array using the delimiter. Null elements are omitted in the result. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

array_max

Returns the maximum value of input array. Supported Signatures
๐Ÿ”— Official Documentation

array_min

Returns the minimum value of input array. Supported Signatures
๐Ÿ”— Official Documentation

array_position

Returns the position of the first occurrence of the element in array x (or 0 if not found). Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

array_remove

Remove all elements that equal element from array x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

array_sort

Sorts and returns the array x. The elements of x must be orderable. Null elements will be placed at the end of the returned array. Supported Signatures
๐Ÿ”— Official Documentation

array_union

Returns an array of the elements in the union of x and y, without duplicates. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

asin

Returns the arc sine of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

atan

Returns the arc tangent of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

atan2

Returns the arc tangent of y / x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

avg

Returns the average (arithmetic mean) of all input values. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

cardinality

Returns the cardinality (size) of the array x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

cbrt

Returns the cube root of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

ceil

This is an alias for ceiling(). Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

ceiling

Returns x rounded up to the nearest integer. Supported Signatures
๐Ÿ”— Official Documentation

chr

Returns the Unicode code point n as a single character string. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

coalesce

Returns the first non-null value in the argument list. Like a CASE expression, arguments are only evaluated if necessary. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

codepoint

Returns the Unicode code point of the only character of string. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

concat

Returns the concatenation of string1, string2, โ€ฆ, stringN. This function provides the same functionality as the SQL-standard concatenation operator (||). Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

concat_ws

Using the first array string0 element as separator, returns the concatenation of all subsequent strings string1, string2, โ€ฆ If `string0โ€œ is null, then the return value is null. Any null values provided in the arguments after the separator are skipped. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

contains

Takes an array and an element. Returns true if the array contains the element, false if not. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

cos

Returns the cosine of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

cosh

Returns the hyperbolic cosine of the given value. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

count

Returns the number of input rows. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

cume_dist

Returns the cumulative distribution of a value in a group of values. The result is the number of rows preceding or peer with the row in the window ordering of the window partition divided by the total number of rows in the window partition. Thus, any tie values in the ordering will evaluate to the same distribution value. Supported Signatures
๐Ÿ”— Official Documentation

current_date

Returns the current date as of the start of the query. Examples:
examples.sql
Supported Signatures
Note: current_date() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

current_time

Returns the current time with time zone as of the start of the query. Examples:
examples.sql
Supported Signatures
Note: current_time() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

current_timestamp

Returns the current timestamp with time zone as of the start of the query, with 3 digits of subsecond precision, Examples:
examples.sql
Supported Signatures
Note: current_timestamp() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

date

This is an alias for CAST(x AS date). Supported Signatures
๐Ÿ”— Official Documentation

date_diff

Takes a unit, timestamp1, and timestamp2. Returns timestamp2 - timestamp1 expressed in terms of unit. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

date_format

Formats timestamp as a string using format. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

date_parse

Parses string into a timestamp using format. Supported Signatures
๐Ÿ”— Official Documentation

date_part

Supported Signatures
๐Ÿ”— Official Documentation

date_trunc

Returns x truncated to unit. Supported Signatures
๐Ÿ”— Official Documentation

day

Returns the day of the month from x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

day_of_month

This is an alias for day(). Supported Signatures
๐Ÿ”— Official Documentation

day_of_week

Returns the ISO day of the week from x. The value ranges from 1 (Monday) to 7 (Sunday). Supported Signatures
๐Ÿ”— Official Documentation

day_of_year

Returns the day of the year from x. The value ranges from 1 to 366. Supported Signatures
๐Ÿ”— Official Documentation

degrees

Converts angle x in radians to degrees. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

dense_rank

Returns the rank of a value in a group of values. This is similar to rank(), except that tie values do not produce gaps in the sequence. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

dow

This is an alias for day_of_week(). Supported Signatures
๐Ÿ”— Official Documentation

doy

This is an alias for day_of_year(). Supported Signatures
๐Ÿ”— Official Documentation

element_at

Returns element of array at given index. If index > 0, this function provides the same functionality as the SQL-standard subscript operator ([]), except that the function returns NULL when accessing an index larger than array length, whereas the subscript operator would fail in such a case. If index < 0, element_at accesses elements from the last to the first. Supported Signatures
๐Ÿ”— Official Documentation

exp

Returns Eulerโ€™s number raised to the power of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

first_value

Returns the first value of the window. Supported Signatures
๐Ÿ”— Official Documentation

flatten

Flattens an array(array(T)) to an array(T) by concatenating the contained arrays. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

floor

Returns x rounded down to the nearest integer. Supported Signatures
๐Ÿ”— Official Documentation

from_unixtime

Returns the UNIX timestamp unixtime as a timestamp with time zone. unixtime is the number of seconds since 1970-01-01 00.00.00 UTC. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

greatest

Returns the largest of the provided values. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

grouping

Supported Signatures
๐Ÿ”— Official Documentation

hour

Returns the hour of the day from x. The value ranges from 0 to 23. Supported Signatures
๐Ÿ”— Official Documentation

if

Evaluates expression parameter and returns second if condition is true, otherwise null is returned and true_value is not evaluated. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

index

Alias for strpos() function. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

is_nan

Determine if x is not-a-number. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

lag

Returns the value at offset rows before the current row in the window partition. Offsets start at 0, which is the current row. The offset can be any scalar expression. The default offset is 1. If the offset is null, an error is raised. If the offset refers to a row that is not within the partition, the default_value is returned, or if it is not specified null is returned. The lag() function requires that the window ordering be specified. Window frame must not be specified. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

last_value

Returns the last value of the window. Supported Signatures
๐Ÿ”— Official Documentation

lead

Returns the value at offset rows after the current row in the window partition. Offsets start at 0, which is the current row. The offset can be any scalar expression. The default offset is 1. If the offset is null, an error is raised. If the offset refers to a row that is not within the partition, the default_value is returned, or if it is not specified null is returned. The lead() function requires that the window ordering be specified. Window frame must not be specified. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

least

Returns the smallest of the provided values. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

length

Returns the length of string in characters. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

levenshtein_distance

Returns the Levenshtein edit distance of string1 and string2, i.e. the minimum number of single-character edits (insertions, deletions or substitutions) needed to change string1 into string2. Supported Signatures
๐Ÿ”— Official Documentation

ln

Returns the natural logarithm of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

localtimestamp

Returns the current timestamp as of the start of the query, with 3 digits of subsecond precision. Supported Signatures
Note: localtimestamp() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

log

Returns the base b logarithm of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

log10

Returns the base 10 logarithm of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

log2

Returns the base 2 logarithm of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

lower

Converts string to lowercase. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

lpad

Left pads string to size characters with padstring. If size is less than the length of string, the result is truncated to size characters. size must not be negative and padstring must be non-empty. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

ltrim

Removes leading whitespace from string. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

max

Returns the maximum value of all input values. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

millisecond

Returns the millisecond of the second from x. Supported Signatures
๐Ÿ”— Official Documentation

min

Returns the minimum value of all input values. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

minute

Returns the minute of the hour from x. Supported Signatures
๐Ÿ”— Official Documentation

mod

Returns the modulus (remainder) of n divided by m. Supported Signatures
๐Ÿ”— Official Documentation

month

Returns the month of the year from x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

now

This is an alias for current_timestamp. Examples:
examples.sql
Supported Signatures
Note: now() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

nth_value

Returns the value at the specified offset from the beginning of the window. Offsets start at 1. The offset can be any scalar expression. If the offset is null or greater than the number of values in the window, null is returned. It is an error for the offset to be zero or negative. Supported Signatures
๐Ÿ”— Official Documentation

ntile

Divides the rows for each window partition into n buckets ranging from 1 to at most n. Bucket values will differ by at most 1. If the number of rows in the partition does not divide evenly into the number of buckets, then the remainder values are distributed one per bucket, starting with the first bucket. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

nullif

Returns null if value1 equals value2, otherwise returns value1. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

percent_rank

Returns the percentage ranking of a value in group of values. The result is (r - 1) / (n - 1) where r is the rank() of the row and n is the total number of rows in the window partition. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

pi

Returns the constant Pi. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

pow

This is an alias for power(). Supported Signatures
๐Ÿ”— Official Documentation

power

Returns x raised to the power of p. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

quarter

Returns the quarter of the year from x. The value ranges from 1 to 4. Supported Signatures
๐Ÿ”— Official Documentation

radians

Converts angle x in degrees to radians. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

rand

This is an alias for random(). Supported Signatures
Note: rand() is volatile, i.e. might return a different value for the same input. ๐Ÿ”— Official Documentation

random

Returns a pseudo-random value in the range 0.0 <= x < 1.0. Examples:
examples.sql
Supported Signatures
Note: random() is volatile, i.e. might return a different value for the same input. ๐Ÿ”— Official Documentation

rank

Returns the rank of a value in a group of values. The rank is one plus the number of rows preceding the row that are not peer with the row. Thus, tie values in the ordering will produce gaps in the sequence. The ranking is performed for each window partition. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

regexp_count

Returns the number of occurrence of pattern in string. Supported Signatures
๐Ÿ”— Official Documentation

regexp_extract

Returns the first substring matched in a string by the regular expression pattern. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

regexp_extract_all

Returns the substrings of a string matched by the regular expression pattern. Supported Signatures
๐Ÿ”— Official Documentation

regexp_like

Evaluates the regular expression pattern and determines if it is contained within string. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

regexp_position

Returns the index of the first occurrence (counting from 1) of pattern in string. Returns -1 if not found. Supported Signatures
๐Ÿ”— Official Documentation

regexp_replace

Removes every instance of the substring matched by the regular expression pattern from string. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

regexp_split

Splits string using the regular expression pattern and returns an array. Trailing empty strings are preserved. Supported Signatures
๐Ÿ”— Official Documentation

repeat

Repeat element for count times. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

replace

Removes all instances of search from string. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

reverse

Returns string with the characters in reverse order. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

round

Returns x rounded to the nearest integer. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

row_number

Returns a unique, sequential number for each row, starting with one, according to the ordering of rows within the window partition. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

rpad

Right pads string to size characters with padstring. If size is less than the length of string, the result is truncated to size characters. size must not be negative and padstring must be non-empty. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

rtrim

Removes trailing whitespace from string. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

second

Returns the second of the minute from x. Supported Signatures
๐Ÿ”— Official Documentation

sha256

Computes the SHA256 hash of binary. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

sha512

Computes the SHA512 hash of binary. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

sign

Returns the signum function of x, that is. Supported Signatures
๐Ÿ”— Official Documentation

sin

Returns the sine of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

sinh

Returns the hyperbolic sine of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

split

Splits string on delimiter and returns an array. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

split_part

Splits string on delimiter and returns the field index. Field indexes start with 1. If the index is larger than the number of fields, then null is returned. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

sqrt

Returns the square root of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

starts_with

Tests whether substring is a prefix of string. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

stddev

This is an alias for stddev_samp(). Supported Signatures
๐Ÿ”— Official Documentation

stddev_pop

Returns the population standard deviation of all input values. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

stddev_samp

Returns the sample standard deviation of all input values. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

strpos

Returns the starting position of the first instance of substring in string. Positions start with 1. If not found, 0 is returned. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

substr

This is an alias for substring(). Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

substring

Returns the rest of string from the starting position start. Positions start with 1. A negative starting position is interpreted as being relative to the end of the string. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

sum

Returns the sum of all input values. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

tan

Returns the tangent of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

tanh

Returns the hyperbolic tangent of x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

to_hex

Encodes binary into a hex string representation. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

to_timestamp_seconds

Supported Signatures
๐Ÿ”— Official Documentation

to_unixtime

Returns timestamp as a UNIX timestamp. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

translate

Returns the source string translated by replacing characters found in the from string with the corresponding characters in the to string. If the from string contains duplicates, only the first is used. If the source character does not exist in the from string, the source character will be copied without translation. If the index of the matching character in the from string is beyond the length of the to string, the source character will be omitted from the resulting string. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

trim

Removes any leading and/or trailing characters as specified up to and including string from source. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

truncate

Returns x rounded to integer by dropping digits after decimal point. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

upper

Converts string to uppercase. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

uuid

Returns a pseudo randomly generated UUID (type 4). Examples:
examples.sql
Supported Signatures
Note: uuid() is volatile, i.e. might return a different value for the same input. ๐Ÿ”— Official Documentation

year

Returns the year from x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation