Lưu ý
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử đăng nhập hoặc thay đổi thư mục.
Cần có ủy quyền mới truy nhập được vào trang này. Bạn có thể thử thay đổi thư mục.
Returns the hex string result of SHA-1. Supports Spark Connect.
For the corresponding Databricks SQL function, see sha1 function.
Syntax
from pyspark.sql import functions as dbf
dbf.sha1(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.sql import functions as dbf
df = spark.createDataFrame([('ABC',)], ['a'])
df.select('*', dbf.sha1('a')).show(truncate=False)
+---+----------------------------------------+
|a |sha1(a) |
+---+----------------------------------------+
|ABC|3c01bdbb26f358bab27f267924aa2c9a03fcfdb8|
+---+----------------------------------------+