This section contains reference documentation for base64 encode and decode functions.
Encoding scheme follows java.util.Base64.Encoder
toBase64 returns Base64 encoded string of input binary data (bytes type).
fromBase64 returns binary data (represented as a Hex string) from Base64-encoded string.
toBase64(bytesCol)
fromBase64(stringCol)
Note that the following query will throw compilation error as string is not a valid input type for toBase64.
aGVsbG8h
hello!
68656c6c6f21
SELECT toBase64(toUtf8('hello!')) AS encoded
FROM ignoreMeSELECT fromUtf8(fromBase64('aGVsbG8h')) AS decoded
FROM ignoreMeSELECT fromBase64('aGVsbG8h') AS decoded
FROM ignoreMeSELECT toBase64('hello!') AS encoded
FROM ignoreMe