datafusion.functions

Functions

abs

acos

array

ascii

Returns the numeric code of the first character of the argument.

asin

atan

avg

This function is not documented yet

bit_length

Returns number of bits in the string (8 times the octet_length).

btrim

Removes the longest string containing only characters in characters (a space by default) from the start and end of string.

ceil

character_length

Returns number of characters in the string.

chr

Returns the character with the given code.

col

Expression representing a column on the existing plan.

concat

Concatenates the text representations of all the arguments.

concat_ws

Concatenates all but the first argument, with separators.

cos

count

This function is not documented yet

exp

floor

in_list

initcap

Converts the first letter of each word to upper case and the rest to lower case.

left

Returns first n characters in the string, or when n is negative, returns all but last |n| characters.

lit

Expression representing a constant value

ln

log10

log2

lower

Converts the string to all lower case

lpad

Extends the string to length length by prepending the characters fill (a space by default).

ltrim

Removes the longest string containing only characters in characters (a space by default) from the start of string.

max

This function is not documented yet

md5

Computes the MD5 hash of the argument, with the result written in hexadecimal.

min

This function is not documented yet

now

Current date and time

octet_length

Returns number of bytes in the string.

random

Returns a random value in the range 0.0 <= x < 1.0

regexp_replace

Replaces substring(s) matching a POSIX regular expression

repeat

Repeats string the specified number of times.

replace

Replaces all occurrences in string of substring from with substring to.

reverse

Reverses the order of the characters in the string.

right

Returns last n characters in the string, or when n is negative, returns all but first |n| characters.

round

rpad

Extends the string to length length by appending the characters fill (a space by default).

rtrim

Removes the longest string containing only characters in characters (a space by default) from the end of string.

sha224

This function is not documented yet

sha256

This function is not documented yet

sha384

This function is not documented yet

sha512

This function is not documented yet

signum

sin

split_part

Splits string at occurrences of delimiter and returns the n’th field (counting from one).

sqrt

starts_with

Returns true if string starts with prefix.

strpos

Returns starting index of specified substring within string, or zero if it’s not present.

substr

This function is not documented yet

sum

This function is not documented yet

tan

to_hex

Converts the number to its equivalent hexadecimal representation.

translate

Replaces each character in string that matches a character in the from set with the corresponding character in the to set.

trim

Removes the longest string containing only characters in characters (a space by default) from the start, end, or both ends (BOTH is the default) of string.

trunc

udaf

Creates a new udf.

udf

Creates a new udf.

upper

Converts the string to all upper case.

class datafusion.functions.Volatility

Bases: object

static immutable()
static stable()
static volatile()
datafusion.functions.abs()
datafusion.functions.acos()
datafusion.functions.approx_distinct()

This function is not documented yet

datafusion.functions.array()
datafusion.functions.ascii()

Returns the numeric code of the first character of the argument. In UTF8 encoding, returns the Unicode code point of the character. In other multibyte encodings, the argument must be an ASCII character.

datafusion.functions.asin()
datafusion.functions.atan()
datafusion.functions.avg()

This function is not documented yet

datafusion.functions.bit_length()

Returns number of bits in the string (8 times the octet_length).

datafusion.functions.btrim()

Removes the longest string containing only characters in characters (a space by default) from the start and end of string.

datafusion.functions.ceil()
datafusion.functions.character_length()

Returns number of characters in the string.

datafusion.functions.chr()

Returns the character with the given code.

datafusion.functions.col()

Expression representing a column on the existing plan.

datafusion.functions.concat_ws()

Concatenates all but the first argument, with separators. The first argument is used as the separator string, and should not be NULL. Other NULL arguments are ignored.

datafusion.functions.concat()

Concatenates the text representations of all the arguments. NULL arguments are ignored.

datafusion.functions.cos()
datafusion.functions.count()

This function is not documented yet

datafusion.functions.exp()
datafusion.functions.floor()
datafusion.functions.in_list()
datafusion.functions.initcap()

Converts the first letter of each word to upper case and the rest to lower case. Words are sequences of alphanumeric characters separated by non-alphanumeric characters.

datafusion.functions.left()

Returns first n characters in the string, or when n is negative, returns all but last |n| characters.

datafusion.functions.lit()

Expression representing a constant value

datafusion.functions.ln()
datafusion.functions.log10()
datafusion.functions.log2()
datafusion.functions.lower()

Converts the string to all lower case

datafusion.functions.lpad()

Extends the string to length length by prepending the characters fill (a space by default). If the string is already longer than length then it is truncated (on the right).

datafusion.functions.ltrim()

Removes the longest string containing only characters in characters (a space by default) from the start of string.

datafusion.functions.max()

This function is not documented yet

datafusion.functions.md5()

Computes the MD5 hash of the argument, with the result written in hexadecimal.

datafusion.functions.digest()

Computes a binary hash of the given data. type is the algorithm to use. Standard algorithms are md5, sha224, sha256, sha384, sha512, blake2s, blake2b, and blake3.

datafusion.functions.min()

This function is not documented yet

datafusion.functions.now()

Current date and time

datafusion.functions.octet_length()

Returns number of bytes in the string. Since this version of the function accepts type character directly, it will not strip trailing spaces.

datafusion.functions.random()

Returns a random value in the range 0.0 <= x < 1.0

datafusion.functions.regexp_replace()

Replaces substring(s) matching a POSIX regular expression

datafusion.functions.repeat()

Repeats string the specified number of times.

datafusion.functions.replace()

Replaces all occurrences in string of substring from with substring to.

datafusion.functions.reverse()

Reverses the order of the characters in the string.

datafusion.functions.right()

Returns last n characters in the string, or when n is negative, returns all but first |n| characters.

datafusion.functions.round()
datafusion.functions.rpad()

Extends the string to length length by appending the characters fill (a space by default). If the string is already longer than length then it is truncated.

datafusion.functions.rtrim()

Removes the longest string containing only characters in characters (a space by default) from the end of string.

datafusion.functions.sha224()

This function is not documented yet

datafusion.functions.sha256()

This function is not documented yet

datafusion.functions.sha384()

This function is not documented yet

datafusion.functions.sha512()

This function is not documented yet

datafusion.functions.signum()
datafusion.functions.sin()
datafusion.functions.split_part()

Splits string at occurrences of delimiter and returns the n’th field (counting from one).

datafusion.functions.sqrt()
datafusion.functions.starts_with()

Returns true if string starts with prefix.

datafusion.functions.strpos()

Returns starting index of specified substring within string, or zero if it’s not present. (Same as position(substring in string), but note the reversed argument order.)

datafusion.functions.substr()

This function is not documented yet

datafusion.functions.sum()

This function is not documented yet

datafusion.functions.tan()
datafusion.functions.to_hex()

Converts the number to its equivalent hexadecimal representation.

datafusion.functions.translate()

Replaces each character in string that matches a character in the from set with the corresponding character in the to set. If from is longer than to, occurrences of the extra characters in from are deleted.

datafusion.functions.trim()

Removes the longest string containing only characters in characters (a space by default) from the start, end, or both ends (BOTH is the default) of string.

datafusion.functions.trunc()
datafusion.functions.udaf()

Creates a new udf.

datafusion.functions.udf()

Creates a new udf.

datafusion.functions.upper()

Converts the string to all upper case.