Knowledge HubColumn Function LibraryString Extras / Hashing

String Extras / Hashing Functions

16 functions for splitting, formatting, hashing, and URL/Base64 encoding. The source column is always the implicit first input.

FunctionSyntaxParametersNotes
splitsplit(column, pattern)pattern default ",".Returns an array column.
split_partsplit_part(column, pattern, index)pattern default ",". index default 1.Returns a single element from the split (1-indexed).
format_valueformat_value(column, format)format default "%s" (printf-style).
raw_to_hexraw_to_hex(column)None.
hex_to_rawhex_to_raw(column)None.
base64_encodebase64_encode(column)None.
base64_decodebase64_decode(column)None.
encodeencode(column, charset)charset default UTF-8.String → binary.
decodedecode(column, charset)charset default UTF-8.Binary → string.
sha1sha1(column)None.
md5md5(column)None.
soundexsoundex(column)None.Phonetic code of the column value.
levenshteinlevenshtein(column, otherColumn)otherColumn — column ref.Edit-distance between the two columns.
url_encodeurl_encode(column)None.
url_decodeurl_decode(column)None.
typeoftypeof(column)None.Returns the Spark SQL type name of the column as a string.