Skip to main content

sha

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

For the corresponding Databricks SQL function, see sha function.

Syntax

Python
from pyspark.databricks.sql import functions as dbf

dbf.sha(col=<col>)

Parameters

Parameter

Type

Description

col

pyspark.sql.Column or str

Target column to compute on.

Examples

Python
from pyspark.databricks.sql import functions as dbf
df = spark.range(1).select(dbf.sha(dbf.lit("Spark")))
df.show()
Output
+--------------------+
| sha(Spark)|
+--------------------+
|85f5955f4b27a9a4c...|
+--------------------+