Module datafusion::physical_plan::string_expressions [−][src]
String expressions
Functions
ascii | Returns the numeric code of the first character of the argument. ascii(‘x’) = 120 |
btrim | Removes the longest string containing only characters in characters (a space by default) from the start and end of string. btrim(‘xyxtrimyyx’, ‘xyz’) = ‘trim’ |
chr | Returns the character with the given code. chr(0) is disallowed because text data types cannot store that character. chr(65) = ‘A’ |
concat | Concatenates the text representations of all the arguments. NULL arguments are ignored. concat(‘abcde’, 2, NULL, 22) = ‘abcde222’ |
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. concat_ws(‘,’, ‘abcde’, 2, NULL, 22) = ‘abcde,2,22’ |
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. initcap(‘hi THOMAS’) = ‘Hi Thomas’ |
lower | Converts the string to all lower case. lower(‘TOM’) = ‘tom’ |
ltrim | Removes the longest string containing only characters in characters (a space by default) from the start of string. ltrim(‘zzzytest’, ‘xyz’) = ‘test’ |
repeat | Repeats string the specified number of times. repeat(‘Pg’, 4) = ‘PgPgPgPg’ |
replace | Replaces all occurrences in string of substring from with substring to. replace(‘abcdefabcdef’, ‘cd’, ‘XX’) = ‘abXXefabXXef’ |
rtrim | Removes the longest string containing only characters in characters (a space by default) from the end of string. rtrim(‘testxxzx’, ‘xyz’) = ‘test’ |
split_part | Splits string at occurrences of delimiter and returns the n’th field (counting from one). split_part(‘abc~@~def~@~ghi’, ‘~@~’, 2) = ‘def’ |
starts_with | Returns true if string starts with prefix. starts_with(‘alphabet’, ‘alph’) = ‘t’ |
to_hex | Converts the number to its equivalent hexadecimal representation. to_hex(2147483647) = ‘7fffffff’ |
upper | Converts the string to all upper case. upper(‘tom’) = ‘TOM’ |