pyspark.sql.functions.bitmap_or_agg#

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

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

New in version 3.5.0.

Parameters
colColumn or str

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

Examples

>>> df = spark.createDataFrame([("10",),("20",),("40",)], ["a"])
>>> df.select(substring(hex(
...     bitmap_or_agg(to_binary(df.a, lit("hex")))
... ), 0, 6).alias("r")).collect()
[Row(r='700000')]