pyspark.sql.functions.md5

pyspark.sql.functions.md5(col: ColumnOrName) → pyspark.sql.column.Column

Calculates the MD5 digest and returns the value as a 32 character hex string.

Examples

>>> spark.createDataFrame([('ABC',)], ['a']).select(md5('a').alias('hash')).collect()
[Row(hash='902fbdd2b1df0c4f70b4a5d23525e932')]