Source
BASE64_DECODE_STRING
Decodes a Base64 - encoded string to a string.
BASE64_ENCODE
Encodes the input (string or binary) using Base64 encoding.
BASE64_DECODE_BINARY
Decodes a Base64 - encoded string to a binary.
TRY_BASE64_DECODE_STRING
A special version of BASE64_DECODE_STRING that returns a NULL value if an error occurs during decoding. BASE64_DECODE_STRING and TRY_BASE64_DECODE_STRING are “reciprocal” (or “converse”) functions of BASE64_ENCODE.
TRY_BASE64_DECODE_BINARY
A special version of BASE64_DECODE_BINARY that returns a NULL value if an error occurs during decoding.
How to avoid "string is not a legal base64-encoded value" error for BASE64_DECODE_STRING function
ISSUE: Similar to traditional OLTP systems like MySQL and PostgreSQL, the BASE64_DECODE_STRING functions in Snowflake don't append '=' if the padding '='s are missing in the original encoded string.
"Invalid UTF8 detected while decoding" error when using BASE64_DECODE_STRING() function
CAUSE: Snowflake is unable to decode the non - UTF8 data which is by design. SOLUTION: This error can be resolved by creating a UDF as mentioned below to detect the illegal characters causing the issue and to modify them.