Scalar functions for manipulating strings
Arroyo’s Scalar function implementations are based on Apache DataFusion and these docs are derived from the DataFusion function reference.
ascii
Returns the ASCII value of the first character in a string.
Arguments
Related functions: chr
bit_length
Returns the bit length of a string.
Arguments
Related functions: length, octet_length
btrim
Trims the specified trim string from the start and end of a string. If no trim string is provided, all whitespace is removed from the start and end of the input string.
Arguments
Related functions: ltrim, rtrim
Aliases
char_length
Alias of length.
character_length
Alias of length.
concat
Concatenates multiple strings together.
Arguments
Related functions: concat_ws
concat_ws
Concatenates multiple strings together with a specified separator.
Arguments
Related functions: concat
chr
Returns the character with the specified ASCII or Unicode code value.
Arguments
Related functions: ascii
ends_with
Tests if a string ends with a substring.
Arguments
initcap
Capitalizes the first character in each word in the input string. Words are delimited by non-alphanumeric characters.
Arguments
Related functions: lower, upper
instr
Alias of strpos.
Arguments
left
Returns a specified number of characters from the left side of a string.
Arguments
Related functions: right
length
Returns the number of characters in a string.
Arguments
Aliases
Related functions: bit_length, octet_length
lower
Converts a string to lower-case.
Arguments
Related functions: initcap, upper
lpad
Pads the left side of a string with another string to a specified string length.
Arguments
Related functions: rpad
ltrim
Trims the specified trim string from the beginning of a string. If no trim string is provided, all whitespace is removed from the start of the input string.
Arguments
Related functions: btrim, rtrim
octet_length
Returns the length of a string in bytes.
Arguments
Related functions: bit_length, length
repeat
Returns a string with an input string repeated a specified number.
Arguments
replace
Replaces all occurrences of a specified substring in a string with a new substring.
Arguments
reverse
Reverses the character order of a string.
Arguments
right
Returns a specified number of characters from the right side of a string.
Arguments
Related functions: left
rpad
Pads the right side of a string with another string to a specified string length.
Arguments
Related functions: lpad
rtrim
Trims the specified trim string from the end of a string. If no trim string is provided, all whitespace is removed from the end of the input string.
Arguments
Related functions: btrim, ltrim
split_part
Splits a string based on a specified delimiter and returns the substring in the specified position.
Arguments
starts_with
Tests if a string starts with a substring.
Arguments
strpos
Returns the starting position of a specified substring in a string. Positions begin at 1. If the substring does not exist in the string, the function returns 0.
Arguments
Aliases
substr
Extracts a substring of a specified number of characters from a specific starting position in a string.
Arguments
translate
Translates characters in a string to specified translation characters.
to_hex
Converts an integer to a hexadecimal string.
Arguments
trim
Alias of btrim.
upper
Converts a string to upper-case.
Arguments
Related functions: initcap, lower
uuid
Returns UUID v4 string value which is unique per row.
overlay
Returns the string which is replaced by another string from the specified position and specified count length.
For example, overlay('Txxxxas' placing 'hom' from 2 for 4) → Thomas
Arguments
levenshtein
Returns the Levenshtein distance between the two given strings.
For example, levenshtein('kitten', 'sitting') = 3
Arguments
substr_index
Returns the substring from str before count occurrences of the delimiter delim.
If count is positive, everything to the left of the final delimiter (counting from the left) is returned.
If count is negative, everything to the right of the final delimiter (counting from the right) is returned.
For example, substr_index('www.apache.org', '.', 1) = www
, substr_index('www.apache.org', '.', -1) = org
Arguments
find_in_set
Returns a value in the range of 1 to N if the string str is in the string list strlist consisting of N substrings.
For example, find_in_set('b', 'a,b,c,d') = 2
Arguments
Scalar functions for manipulating strings
Arroyo’s Scalar function implementations are based on Apache DataFusion and these docs are derived from the DataFusion function reference.
ascii
Returns the ASCII value of the first character in a string.
Arguments
Related functions: chr
bit_length
Returns the bit length of a string.
Arguments
Related functions: length, octet_length
btrim
Trims the specified trim string from the start and end of a string. If no trim string is provided, all whitespace is removed from the start and end of the input string.
Arguments
Related functions: ltrim, rtrim
Aliases
char_length
Alias of length.
character_length
Alias of length.
concat
Concatenates multiple strings together.
Arguments
Related functions: concat_ws
concat_ws
Concatenates multiple strings together with a specified separator.
Arguments
Related functions: concat
chr
Returns the character with the specified ASCII or Unicode code value.
Arguments
Related functions: ascii
ends_with
Tests if a string ends with a substring.
Arguments
initcap
Capitalizes the first character in each word in the input string. Words are delimited by non-alphanumeric characters.
Arguments
Related functions: lower, upper
instr
Alias of strpos.
Arguments
left
Returns a specified number of characters from the left side of a string.
Arguments
Related functions: right
length
Returns the number of characters in a string.
Arguments
Aliases
Related functions: bit_length, octet_length
lower
Converts a string to lower-case.
Arguments
Related functions: initcap, upper
lpad
Pads the left side of a string with another string to a specified string length.
Arguments
Related functions: rpad
ltrim
Trims the specified trim string from the beginning of a string. If no trim string is provided, all whitespace is removed from the start of the input string.
Arguments
Related functions: btrim, rtrim
octet_length
Returns the length of a string in bytes.
Arguments
Related functions: bit_length, length
repeat
Returns a string with an input string repeated a specified number.
Arguments
replace
Replaces all occurrences of a specified substring in a string with a new substring.
Arguments
reverse
Reverses the character order of a string.
Arguments
right
Returns a specified number of characters from the right side of a string.
Arguments
Related functions: left
rpad
Pads the right side of a string with another string to a specified string length.
Arguments
Related functions: lpad
rtrim
Trims the specified trim string from the end of a string. If no trim string is provided, all whitespace is removed from the end of the input string.
Arguments
Related functions: btrim, ltrim
split_part
Splits a string based on a specified delimiter and returns the substring in the specified position.
Arguments
starts_with
Tests if a string starts with a substring.
Arguments
strpos
Returns the starting position of a specified substring in a string. Positions begin at 1. If the substring does not exist in the string, the function returns 0.
Arguments
Aliases
substr
Extracts a substring of a specified number of characters from a specific starting position in a string.
Arguments
translate
Translates characters in a string to specified translation characters.
to_hex
Converts an integer to a hexadecimal string.
Arguments
trim
Alias of btrim.
upper
Converts a string to upper-case.
Arguments
Related functions: initcap, lower
uuid
Returns UUID v4 string value which is unique per row.
overlay
Returns the string which is replaced by another string from the specified position and specified count length.
For example, overlay('Txxxxas' placing 'hom' from 2 for 4) → Thomas
Arguments
levenshtein
Returns the Levenshtein distance between the two given strings.
For example, levenshtein('kitten', 'sitting') = 3
Arguments
substr_index
Returns the substring from str before count occurrences of the delimiter delim.
If count is positive, everything to the left of the final delimiter (counting from the left) is returned.
If count is negative, everything to the right of the final delimiter (counting from the right) is returned.
For example, substr_index('www.apache.org', '.', 1) = www
, substr_index('www.apache.org', '.', -1) = org
Arguments
find_in_set
Returns a value in the range of 1 to N if the string str is in the string list strlist consisting of N substrings.
For example, find_in_set('b', 'a,b,c,d') = 2
Arguments