[ 
https://issues.apache.org/jira/browse/SPARK-53877?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Uros Stojkovic updated SPARK-53877:
-----------------------------------
    Description: 
Introduce a function analogous to bitmap_or_agg, but performing a bitwise AND 
operation instead of OR.

Specifically, the bitmap_and_agg function should output a bitmap that 
represents the bitwise AND of all bitmaps in the input column. The input column 
must contain bitmaps generated from bitmap_construct_agg(). 

Example:
{code:java}
>>> from pyspark.sql import functions as sf
>>> df = spark.createDataFrame([("30",),("70",),("F0",)], ["a"])
>>> df.select(sf.bitmap_and_agg(sf.to_binary(df.a, sf.lit("hex")))).show()

+--------------------------------+
|bitmap_and_agg(to_binary(a, hex))|
+--------------------------------+
|            [30 00 00 00 00 0...|
+--------------------------------+{code}

  was:
Introduce a function analogous to bitmap_or_agg, but performing a bitwise AND 
operation instead of OR.

Specifically, the bitmap_and_agg function should output a bitmap that 
represents the bitwise AND of all bitmaps in the input column. The input column 
must contain bitmaps generated from bitmap_construct_agg().
Example:

 
{code:java}
>>> from pyspark.sql import functions as sf
>>> df = spark.createDataFrame([("30",),("70",),("F0",)], ["a"])
>>> df.select(sf.bitmap_and_agg(sf.to_binary(df.a, sf.lit("hex")))).show()

+--------------------------------+
|bitmap_and_agg(to_binary(a, hex))|
+--------------------------------+
|            [30 00 00 00 00 0...|
+--------------------------------+{code}
 

 


> Add bitmap_and_agg aggregation function
> ---------------------------------------
>
>                 Key: SPARK-53877
>                 URL: https://issues.apache.org/jira/browse/SPARK-53877
>             Project: Spark
>          Issue Type: New Feature
>          Components: Documentation, PySpark, SQL
>    Affects Versions: 4.1.0
>            Reporter: Uros Stojkovic
>            Priority: Major
>              Labels: pull-request-available
>   Original Estimate: 168h
>  Remaining Estimate: 168h
>
> Introduce a function analogous to bitmap_or_agg, but performing a bitwise AND 
> operation instead of OR.
> Specifically, the bitmap_and_agg function should output a bitmap that 
> represents the bitwise AND of all bitmaps in the input column. The input 
> column must contain bitmaps generated from bitmap_construct_agg(). 
> Example:
> {code:java}
> >>> from pyspark.sql import functions as sf
> >>> df = spark.createDataFrame([("30",),("70",),("F0",)], ["a"])
> >>> df.select(sf.bitmap_and_agg(sf.to_binary(df.a, sf.lit("hex")))).show()
> +--------------------------------+
> |bitmap_and_agg(to_binary(a, hex))|
> +--------------------------------+
> |            [30 00 00 00 00 0...|
> +--------------------------------+{code}



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to