Base64
This section contains reference documentation for base64 encode and decode functions.
Encoding scheme follows java.util.Base64.Encoder
toBase64returns Base64 encoded string of input binary data (bytestype).fromBase64returns binary data (represented as a Hex string) from Base64-encoded string.
Signature
toBase64(bytesCol)
fromBase64(stringCol)
Usage Examples
SELECT toBase64(toUtf8('hello!')) AS encoded
FROM ignoreMeencoded
aGVsbG8h
SELECT fromUtf8(fromBase64('aGVsbG8h')) AS decoded
FROM ignoreMedecoded
hello!
SELECT fromBase64('aGVsbG8h') AS decoded
FROM ignoreMedecoded
68656c6c6f21
Note that the following query will throw compilation error as string is not a valid input type for toBase64.
SELECT toBase64('hello!') AS encoded
FROM ignoreMeLast updated
Was this helpful?

