Skip to main content

unbase64

Decodes a BASE64 encoded string column and returns it as a binary column.

For the corresponding Databricks SQL function, see unbase64 function.

Syntax

Python
from pyspark.databricks.sql import functions as dbf

dbf.unbase64(col=<col>)

Parameters

Parameter

Type

Description

col

pyspark.sql.Column or str

target column to work on.

Returns

pyspark.sql.Column: encoded string value.

Examples

Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame(["U3Bhcms=", "UHlTcGFyaw==", "UGFuZGFzIEFQSQ=="], "STRING")
df.select("*", dbf.unbase64("value")).show(truncate=False)