pyspark.sql.functions.
hash
Calculates the hash code of given columns, and returns the result as an int column.
New in version 2.0.0.
Examples
>>> spark.createDataFrame([('ABC',)], ['a']).select(hash('a').alias('hash')).collect() [Row(hash=-757602832)]
previous
pyspark.sql.functions.grouping_id
next
pyspark.sql.functions.hex