Skip to main content

bitmap_and_agg

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

Syntax

Python
from pyspark.databricks.sql import functions as dbf

dbf.bitmap_and_agg(col=<col>)

Parameters

Parameter

Type

Description

col

pyspark.sql.Column or column name

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

Examples

Python
from pyspark.databricks.sql import functions as dbf
df = spark.createDataFrame([("F0",),("70",),("30",)], ["a"])
df.select(dbf.bitmap_and_agg(dbf.to_binary(df.a, dbf.lit("hex")))).show()
Output
+---------------------------------+
|bitmap_and_agg(to_binary(a, hex))|
+---------------------------------+
| [30 00 00 00 00 0...|
+---------------------------------+