All Supported Functions
abs
Returns the absolute value of x.
Examples:
Supported Signatures
acos
Returns the arc cosine of x.
Examples:
Supported Signatures
array_agg
Returns an array created from the input x elements.
Examples:
Supported Signatures
array_distinct
Remove duplicate values from the array x.
Examples:
Supported Signatures
array_except
Returns an array of elements in x but not in y, without duplicates.
Examples:
Supported Signatures
array_intersect
Returns an array of the elements in the intersection of x and y, without duplicates.
Examples:
Supported Signatures
array_join
Concatenates the elements of the given array using the delimiter. Null elements are omitted in the result.
Examples:
Supported Signatures
array_max
Returns the maximum value of input array.
Supported Signatures
array_min
Returns the minimum value of input array.
Supported Signatures
array_position
Returns the position of the first occurrence of the element in array x (or 0 if not found).
Examples:
Supported Signatures
array_remove
Remove all elements that equal element from array x.
Examples:
Supported Signatures
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
array_union
Returns an array of the elements in the union of x and y, without duplicates.
Examples:
Supported Signatures
asin
Returns the arc sine of x.
Examples:
Supported Signatures
atan
Returns the arc tangent of x.
Examples:
Supported Signatures
atan2
Returns the arc tangent of y / x.
Examples:
Supported Signatures
avg
Returns the average (arithmetic mean) of all input values.
Examples:
Supported Signatures
cardinality
Returns the cardinality (size) of the array x.
Examples:
Supported Signatures
cbrt
Returns the cube root of x.
Examples:
Supported Signatures
ceil
This is an alias for ceiling().
Examples:
Supported Signatures
ceiling
Returns x rounded up to the nearest integer.
Supported Signatures
chr
Returns the Unicode code point n as a single character string.
Examples:
Supported Signatures
coalesce
Returns the first non-null value in the argument list. Like a CASE expression, arguments are only evaluated if necessary.
Examples:
Supported Signatures
codepoint
Returns the Unicode code point of the only character of string
.
Examples:
Supported Signatures
concat
Returns the concatenation of string1, string2, …, stringN. This function provides the same functionality as the SQL-standard concatenation operator (||).
Examples:
Supported Signatures
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:
Supported Signatures
contains
Takes an array and an element. Returns true if the array contains the element, false if not.
Examples:
Supported Signatures
cos
Returns the cosine of x.
Examples:
Supported Signatures
cosh
Returns the hyperbolic cosine of the given value.
Examples:
Supported Signatures
count
Returns the number of input rows.
Examples:
Supported Signatures
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
current_date
Returns the current date as of the start of the query.
Examples:
Supported Signatures
Note: current_date() is stable, i.e. might return a different value for a different query execution.
current_time
Returns the current time with time zone as of the start of the query.
Examples:
Supported Signatures
Note: current_time() is stable, i.e. might return a different value for a different query execution.
current_timestamp
Returns the current timestamp with time zone as of the start of the query, with 3 digits of subsecond precision,
Examples:
Supported Signatures
Note: current_timestamp() is stable, i.e. might return a different value for a different query execution.
date
This is an alias for CAST(x AS date).
Supported Signatures
date_diff
Takes a unit, timestamp1, and timestamp2. Returns timestamp2 - timestamp1 expressed in terms of unit.
Examples:
Supported Signatures
date_format
Formats timestamp as a string using format.
Examples:
Supported Signatures
date_parse
Parses string into a timestamp using format.
Supported Signatures
date_part
Supported Signatures
date_trunc
Returns x truncated to unit.
Supported Signatures
day
Returns the day of the month from x.
Examples:
Supported Signatures
day_of_month
This is an alias for day().
Supported Signatures
day_of_week
Returns the ISO day of the week from x. The value ranges from 1 (Monday) to 7 (Sunday).
Supported Signatures
day_of_year
Returns the day of the year from x. The value ranges from 1 to 366.
Supported Signatures
degrees
Converts angle x in radians to degrees.
Examples:
Supported Signatures
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:
Supported Signatures
dow
This is an alias for day_of_week().
Supported Signatures
doy
This is an alias for day_of_year().
Supported Signatures
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
exp
Returns Euler’s number raised to the power of x.
Examples:
Supported Signatures
first_value
Returns the first value of the window.
Supported Signatures
flatten
Flattens an array(array(T)) to an array(T) by concatenating the contained arrays.
Examples:
Supported Signatures
floor
Returns x rounded down to the nearest integer.
Supported Signatures
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:
Supported Signatures
greatest
Returns the largest of the provided values.
Examples:
Supported Signatures
grouping
Supported Signatures
hour
Returns the hour of the day from x. The value ranges from 0 to 23.
Supported Signatures
if
Evaluates expression parameter and returns second if condition is true, otherwise null is returned and true_value is not evaluated.
Examples:
Supported Signatures
index
Alias for strpos() function.
Examples:
Supported Signatures
is_nan
Determine if x
is not-a-number.
Examples:
Supported Signatures
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:
Supported Signatures
last_value
Returns the last value of the window.
Supported Signatures
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:
Supported Signatures
least
Returns the smallest of the provided values.
Examples:
Supported Signatures
length
Returns the length of string in characters.
Examples:
Supported Signatures
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
ln
Returns the natural logarithm of x.
Examples:
Supported Signatures
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.
log
Returns the base b logarithm of x.
Examples:
Supported Signatures
log10
Returns the base 10 logarithm of x.
Examples:
Supported Signatures
log2
Returns the base 2 logarithm of x.
Examples:
Supported Signatures
lower
Converts string to lowercase.
Examples:
Supported Signatures
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:
Supported Signatures
ltrim
Removes leading whitespace from string.
Examples:
Supported Signatures
max
Returns the maximum value of all input values.
Examples:
Supported Signatures
millisecond
Returns the millisecond of the second from x.
Supported Signatures
min
Returns the minimum value of all input values.
Examples:
Supported Signatures
minute
Returns the minute of the hour from x.
Supported Signatures
mod
Returns the modulus (remainder) of n divided by m.
Supported Signatures
month
Returns the month of the year from x.
Examples:
Supported Signatures
now
This is an alias for current_timestamp.
Examples:
Supported Signatures
Note: now() is stable, i.e. might return a different value for a different query execution.
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
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:
Supported Signatures
nullif
Returns null if value1 equals value2, otherwise returns value1.
Examples:
Supported Signatures
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:
Supported Signatures
pi
Returns the constant Pi.
Examples:
Supported Signatures
pow
This is an alias for power().
Supported Signatures
power
Returns x raised to the power of p.
Examples:
Supported Signatures
quarter
Returns the quarter of the year from x. The value ranges from 1 to 4.
Supported Signatures
radians
Converts angle x in degrees to radians.
Examples:
Supported Signatures
rand
This is an alias for random().
Supported Signatures
Note: rand() is volatile, i.e. might return a different value for the same input.
random
Returns a pseudo-random value in the range 0.0 <= x < 1.0.
Examples:
Supported Signatures
Note: random() is volatile, i.e. might return a different value for the same input.
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:
Supported Signatures
regexp_count
Returns the number of occurrence of pattern in string.
Supported Signatures
regexp_extract
Returns the first substring matched in a string by the regular expression pattern.
Examples:
Supported Signatures
regexp_extract_all
Returns the substrings of a string matched by the regular expression pattern.
Supported Signatures
regexp_like
Evaluates the regular expression pattern and determines if it is contained within string.
Examples:
Supported Signatures
regexp_position
Returns the index of the first occurrence (counting from 1) of pattern in string. Returns -1 if not found.
Supported Signatures
regexp_replace
Removes every instance of the substring matched by the regular expression pattern from string.
Examples:
Supported Signatures
regexp_split
Splits string using the regular expression pattern and returns an array. Trailing empty strings are preserved.
Supported Signatures
repeat
Repeat element for count times.
Examples:
Supported Signatures
replace
Removes all instances of search from string.
Examples:
Supported Signatures
reverse
Returns string with the characters in reverse order.
Examples:
Supported Signatures
round
Returns x rounded to the nearest integer.
Examples:
Supported Signatures
row_number
Returns a unique, sequential number for each row, starting with one, according to the ordering of rows within the window partition.
Examples:
Supported Signatures
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:
Supported Signatures
rtrim
Removes trailing whitespace from string.
Examples:
Supported Signatures
second
Returns the second of the minute from x.
Supported Signatures
sha256
Computes the SHA256 hash of binary.
Examples:
Supported Signatures
sha512
Computes the SHA512 hash of binary.
Examples:
Supported Signatures
sign
Returns the signum function of x, that is.
Supported Signatures
sin
Returns the sine of x.
Examples:
Supported Signatures
sinh
Returns the hyperbolic sine of x.
Examples:
Supported Signatures
split
Splits string on delimiter and returns an array.
Examples:
Supported Signatures
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:
Supported Signatures
sqrt
Returns the square root of x.
Examples:
Supported Signatures
starts_with
Tests whether substring is a prefix of string.
Examples:
Supported Signatures
stddev
This is an alias for stddev_samp().
Supported Signatures
stddev_pop
Returns the population standard deviation of all input values.
Examples:
Supported Signatures
stddev_samp
Returns the sample standard deviation of all input values.
Examples:
Supported Signatures
strpos
Returns the starting position of the first instance of substring in string. Positions start with 1. If not found, 0 is returned.
Examples:
Supported Signatures
substr
This is an alias for substring().
Examples:
Supported Signatures
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:
Supported Signatures
sum
Returns the sum of all input values.
Examples:
Supported Signatures
tan
Returns the tangent of x.
Examples:
Supported Signatures
tanh
Returns the hyperbolic tangent of x.
Examples:
Supported Signatures
to_hex
Encodes binary into a hex string representation.
Examples:
Supported Signatures
to_timestamp_seconds
Supported Signatures
to_unixtime
Returns timestamp as a UNIX timestamp.
Examples:
Supported Signatures
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:
Supported Signatures
trim
Removes any leading and/or trailing characters as specified up to and including string from source.
Examples:
Supported Signatures
truncate
Returns x rounded to integer by dropping digits after decimal point.
Examples:
Supported Signatures
upper
Converts string to uppercase.
Examples:
Supported Signatures
uuid
Returns a pseudo randomly generated UUID (type 4).
Examples:
Supported Signatures
Note: uuid() is volatile, i.e. might return a different value for the same input.
year
Returns the year from x.
Examples:
Supported Signatures