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
- col
Column
or column name The input column should be bitmaps created from bitmap_construct_agg().
- col
See also
Examples
>>> from pyspark.sql import functions as sf >>> df = spark.createDataFrame([("10",),("20",),("40",)], ["a"]) >>> df.select(sf.bitmap_or_agg(sf.to_binary(df.a, sf.lit("hex")))).show() +--------------------------------+ |bitmap_or_agg(to_binary(a, hex))| +--------------------------------+ | [70 00 00 00 00 0...| +--------------------------------+