snowflake.snowpark.functions.bitmap_construct_agg

snowflake.snowpark.functions.bitmap_construct_agg(relative_position: Union[Column, str]) Column[source] (https://github.com/snowflakedb/snowpark-python/blob/v1.30.0/snowpark-python/src/snowflake/snowpark/functions.py#L10990-L11004)

Returns a bitmap constructed from the relative positions of the input values.

Example:

>>> df = session.create_dataframe([1, 32769], schema=["a"])
>>> df.select(bitmap_bucket_number(df["a"]).alias("bitmap_id"),bitmap_bit_position(df["a"]).alias("bit_position")).group_by("bitmap_id").agg(bitmap_construct_agg(col("bit_position")).alias("bitmap")).collect()
[Row(BITMAP_ID=1, BITMAP=bytearray(b'\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00')), Row(BITMAP_ID=2, BITMAP=bytearray(b'\x00\x01\x00\x00\x00\x00\x00\x00\x00\x00'))]
Copy
Language: English