String Functions
A list of available functions to manipulate string types
Functions
Section titled “Functions”concat_with_separator(separator:string:…)
Section titled “concat_with_separator(separator:string:…)”Concatenate many strings, separated by separator. NULL inputs are skipped.
concat_with_separator(separator: STRING, string: STRING, ...: STRING) -> STRING
concat(value:…)
Section titled “concat(value:…)”Concatenate many strings. NULL inputs are skipped. See also string || string.
concat(value: STRING, ...: STRING) -> STRING
contains(value:search_string:)
Section titled “contains(value:search_string:)”Return true if search_string is found within string.
contains(value: STRING, search_string: STRING) -> BOOLEAN
ends_with(value:search_string:)
Section titled “ends_with(value:search_string:)”Return true if string ends with search_string.
ends_with(value: STRING, search_string: STRING) -> BOOLEAN
greatest(x1:x2:…)
Section titled “greatest(x1:x2:…)”Selects the largest value using lexicographical ordering. Note that lowercase characters are considered ‘larger’ than uppercase characters.
greatest(x1: STRING, x2: STRING, ...: STRING) -> STRING
least(x1:x2:…)
Section titled “least(x1:x2:…)”Selects the smallest value using lexicographical ordering. Note that uppercase characters are considered ‘smaller’ than lowercase characters.
least(x1: STRING, x2: STRING, ...: STRING) -> STRING
from_base64(value:)
Section titled “from_base64(value:)”Convert a base64 encoded string to a character string.
from_base64(value: STRING) -> STRING
length(value:)
Section titled “length(value:)”Number of characters in string.
length(value: STRING) -> BIGINT
lower(value:)
Section titled “lower(value:)”Convert string to lower case.
lower(value: STRING) -> STRING
md5_hash(value:)
Section titled “md5_hash(value:)”Returns the MD5 hash of the string as a VARCHAR.
md5_hash(value: STRING) -> STRING
regex_extract_first(string:pattern:options?)
Section titled “regex_extract_first(string:pattern:options?)”Extracts the first matched sequence of characters that matches the regular expression pattern.
regex_extract_first(string: STRING, pattern: STRING, options?: STRING) -> STRING
regex_extract_all(string:pattern:options?)
Section titled “regex_extract_all(string:pattern:options?)”Extracts non-overlapping occurrences of regex in string. A set of optional options can be set.
regex_extract_all(string: STRING, pattern: STRING, options?: STRING) -> STRING[]
regex_replace_all(string:pattern:replacement:options?)
Section titled “regex_replace_all(string:pattern:replacement:options?)”If string contains the regex pattern, replaces all matching parts with replacement. A set of optional options can be set.
regex_replace_all(string: STRING, pattern: STRING, replacement: STRING, options?: STRING) -> STRING[]
regex_contains(string:pattern:)
Section titled “regex_contains(string:pattern:)”Returns ‘true’ if string contains the regex pattern, otherwise false.
regex_contains(string: STRING, pattern: STRING) -> STRING[]
replace(string:source:target:)
Section titled “replace(string:source:target:)”Replaces any occurances of the source with the target within string.
replace(string: STRING, source: STRING, target: STRING) -> STRING
reverse(value:)
Section titled “reverse(value:)”Reverses the provided value.
reverse(value: STRING) -> STRING
sha256_hash(value:)
Section titled “sha256_hash(value:)”Returns a VARCHAR with the SHA-256 hash of the value.
sha256_hash(value: STRING) -> STRING
split(value:separator:)
Section titled “split(value:separator:)”Splits the string along the separator.
split(value: STRING, separator: STRING) -> STRING[]
trim(value:)
Section titled “trim(value:)”Removes any spaces from either side of the string.
trim(value: STRING) -> STRING
trim_clean(value:characters:)
Section titled “trim_clean(value:characters:)”Removes any occurrences of any of the characters from either side of the string.
trim_clean(value: STRING, characters: STRING) -> STRING
upper(value:)
Section titled “upper(value:)”Convert string to upper case.
upper(value: STRING) -> STRING