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
Columnor column name The input column should be bitmaps created from bitmap_construct_agg().
- col
See also
pyspark.sql.functions.bitmap_bit_position()pyspark.sql.functions.bitmap_bucket_number()pyspark.sql.functions.bitmap_construct_agg()pyspark.sql.functions.bitmap_count()pyspark.sql.functions.bitmap_and_agg()
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...| +--------------------------------+