pyspark.sql.functions.bit_xor

pyspark.sql.functions.bit_xor(col: ColumnOrName) → pyspark.sql.column.Column[source]

Aggregate function: returns the bitwise XOR of all non-null input values, or null if none.

New in version 3.5.0.

Parameters
colColumn or str

target column to compute on.

Returns
Column

the bitwise XOR of all non-null input values, or null if none.

Examples

>>> df = spark.createDataFrame([[1],[1],[2]], ["c"])
>>> df.select(bit_xor("c")).first()
Row(bit_xor(c)=2)