pyspark.sql.functions.bitmap_construct_agg

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

Returns a bitmap with the positions of the bits set from all the values from the input column. The input column will most likely be bitmap_bit_position().

New in version 3.5.0.

Parameters
colColumn or str

The input column will most likely be bitmap_bit_position().

Examples

>>> df = spark.createDataFrame([(1,),(2,),(3,)], ["a"])
>>> df.select(substring(hex(
...     bitmap_construct_agg(bitmap_bit_position(df.a))
... ), 0, 6).alias("r")).collect()
[Row(r='070000')]