uros7251brick opened a new pull request, #52586:
URL: https://github.com/apache/spark/pull/52586
<!--
Thanks for sending a pull request! Here are some tips for you:
1. If this is your first time, please read our contributor guidelines:
https://spark.apache.org/contributing.html
2. Ensure you have added or run the appropriate tests for your PR:
https://spark.apache.org/developer-tools.html
3. If the PR is unfinished, add '[WIP]' in your PR title, e.g.,
'[WIP][SPARK-XXXX] Your PR title ...'.
4. Be sure to keep the PR description updated to reflect all changes.
5. Please write your PR title to summarize what this PR proposes.
6. If possible, provide a concise example to reproduce the issue for a
faster review.
7. If you want to add a new configuration, please read the guideline first
for naming configurations in
'core/src/main/scala/org/apache/spark/internal/config/ConfigEntry.scala'.
8. If you want to add or modify an error type or message, please read the
guideline first in
'common/utils/src/main/resources/error/README.md'.
-->
Currently, Spark has two bitmap aggregation functions `bitmap_construct_agg`
and `bitmap_or_agg` for constructing a bitmap out of set of integers and
performing union on two sets represented by bitmaps, respectively. However,
efficient intersect operation (bitwise AND) is missing.
## What changes were proposed in this pull request?
- **Implemented `bitmap_and_agg` expression**: New aggregation function that
performs bitwise AND operations on binary column inputs.
<!--
Please fill in changes proposed in this fix.
-->
### Design Decisions
- **Result on empty input is identity element for the operation**: Empty
input groups return all-ones bitmaps (AND identity).
- **Missing bytes handling**: For AND operations, missing bytes in input are
treated as zeros to maintain intersection semantics.
## How was this patch tested?
Added new test cases to cover `bitmap_and_agg` functionality:
- **`BitmapExpressionsQuerySuite`**: Added test cases for basic AND
operations, edge cases, empty group handling, and integration with other bitmap
functions.
### Does this PR introduce _any_ user-facing change?
No.
<!--
Note that it means *any* user-facing change including all aspects such as
new features, bug fixes, or other behavior changes. Documentation-only updates
are not considered user-facing changes.
If yes, please clarify the previous behavior and the change this PR proposes
- provide the console output, description and/or an example to show the
behavior difference if possible.
If possible, please also clarify if this is a user-facing change compared to
the released Spark versions or within the unreleased branches such as master.
If no, write 'No'.
-->
### Was this patch authored or co-authored using generative AI tooling?
No.
<!--
If generative AI tooling has been used in the process of authoring this
patch, please include the
phrase: 'Generated-by: ' followed by the name of the tool and its version.
If no, write 'No'.
Please refer to the [ASF Generative Tooling
Guidance](https://www.apache.org/legal/generative-tooling.html) for details.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]