String Functions
chr
Returns the Unicode code point n as a single character string.
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
from_utf8
Decodes a UTF-8 encoded string from binary. Invalid UTF-8 sequences are replaced with the Unicode replacement character U+FFFD.
Supported Signatures
hamming_distance
Returns the Hamming distance of string1 and string2, i.e. the number of positions at which the corresponding characters are different. Note that the two strings must have the same length.
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
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.
Supported Signatures
ltrim
Removes leading whitespace from string.
Examples:
Supported Signatures
luhn_check
Tests whether a string of digits is valid according to the Luhn algorithm.
Supported Signatures
normalize
Transforms string with NFC normalization form.
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
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.
Supported Signatures
rtrim
Removes trailing whitespace from string.
Examples:
Supported Signatures
soundex
It is typically used to evaluate the similarity of two expressions phonetically, that is how the string sounds when spoken.
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
split_to_map
Splits string by entryDelimiter and keyValueDelimiter and returns a map. entryDelimiter splits string into key-value pairs. keyValueDelimiter splits each pair into key and value.
Supported Signatures
split_to_multimap
Splits string by entryDelimiter and keyValueDelimiter and returns a map containing an array of values for each unique key. entryDelimiter splits string into key-value pairs. keyValueDelimiter splits each pair into key and value. The values for each key will be in the same order as they appeared in string.
Supported Signatures
starts_with
Tests whether substring is a prefix of string.
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
to_utf8
Encodes string into a UTF-8 varbinary representation.
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
upper
Converts string to uppercase.
Examples:
Supported Signatures
word_stem
Returns the stem of word in the English language.
Supported Signatures