pyspark.sql.functions.sha

pyspark.sql.functions.sha(col: ColumnOrName) → pyspark.sql.column.Column[source]

Returns a sha1 hash value as a hex string of the col.

New in version 3.5.0.

Parameters
colColumn or str

Examples

>>> import pyspark.sql.functions as sf
>>> spark.range(1).select(sf.sha(sf.lit("Spark"))).show()
+--------------------+
|          sha(Spark)|
+--------------------+
|85f5955f4b27a9a4c...|
+--------------------+