pyspark.sql.functions.
hex
Computes hex value of the given column, which could be pyspark.sql.types.StringType, pyspark.sql.types.BinaryType, pyspark.sql.types.IntegerType or pyspark.sql.types.LongType.
pyspark.sql.types.StringType
pyspark.sql.types.BinaryType
pyspark.sql.types.IntegerType
pyspark.sql.types.LongType
New in version 1.5.0.
Changed in version 3.4.0: Supports Spark Connect.
Column
target column to work on.
hexadecimal representation of given value as string.
Examples
>>> spark.createDataFrame([('ABC', 3)], ['a', 'b']).select(hex('a'), hex('b')).collect() [Row(hex(a)='414243', hex(b)='3')]