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.
Returns a sha1 hash value as a hex string of the column.
For the corresponding Databricks SQL function, see sha function.
Syntax
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
from pyspark.databricks.sql import functions as dbf
df = spark.range(1).select(dbf.sha(dbf.lit("Spark")))
df.show()
+--------------------+
| sha(Spark)|
+--------------------+
|85f5955f4b27a9a4c...|
+--------------------+