Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Calculates the MD5 digest and returns the value as a 32 character hex string. Supports Spark Connect.
For the corresponding Databricks SQL function, see md5 function.
Syntax
from pyspark.databricks.sql import functions as dbf
dbf.md5(col=<col>)
Parameters
| Parameter | Type | Description |
|---|---|---|
col |
pyspark.sql.Column or str |
Target column to compute on. |
Returns
pyspark.sql.Column: the column for computed results.
Examples
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([('ABC',)], ['a'])
df.select('*', dbf.md5('a')).show(truncate=False)
+---+--------------------------------+
|a |md5(a) |
+---+--------------------------------+
|ABC|902fbdd2b1df0c4f70b4a5d23525e932|
+---+--------------------------------+