pyspark.sql.functions.bitmap_xor_agg#

pyspark.sql.functions.bitmap_xor_agg(col)[source]#

Returns a bitmap that is the bitwise XOR of all of the bitmaps from the input column. The input column should be bitmaps created from bitmap_construct_agg().

Added in version 4.4.0.

Parameters:
colColumn or column name

The input column should be bitmaps created from bitmap_construct_agg().

Examples

>>> from pyspark.sql import functions as sf
>>> df = spark.createDataFrame([("10",), ("30",), ("40",)], ["a"])
>>> df.select(sf.bitmap_xor_agg(sf.to_binary(df.a, sf.lit("hex")))).show()
+---------------------------------+
|bitmap_xor_agg(to_binary(a, hex))|
+---------------------------------+
|             [60 00 00 00 00 0...|
+---------------------------------+