Skip to content

[FLINK-39187][table] Add core built-in aggregate functions for BITMAP#27821

Open
dylanhz wants to merge 4 commits intoapache:masterfrom
dylanhz:FLINK-39187
Open

[FLINK-39187][table] Add core built-in aggregate functions for BITMAP#27821
dylanhz wants to merge 4 commits intoapache:masterfrom
dylanhz:FLINK-39187

Conversation

@dylanhz
Copy link
Contributor

@dylanhz dylanhz commented Mar 25, 2026

What is the purpose of the change

This is the fifth PR for FLIP-556, following #27817.

This PR introduces built-in aggregate functions for the BITMAP type, including bitmap-returning aggregations and their cardinality-returning variants.

Brief change log

- [hotfix] Made `RoaringBitmapData` implement `Serializable` and removed unused `wrap` method
- Added `BITMAP_BUILD_AGG` aggregate function with retraction support
- Added `BITMAP_AND_AGG`, `BITMAP_OR_AGG`, `BITMAP_XOR_AGG` aggregate functions with retraction support
- Added cardinality-returning variants (`BITMAP_AND_COUNT`, `BITMAP_OR_COUNT`, `BITMAP_XOR_COUNT`) via abstract base class refactoring
- Added documentation (EN/ZH), Java Table API, and PyFlink bindings for all functions

Verifying this change

This change added tests and can be verified as follows:

- `BitmapAggFunctionITCase`: Integration tests for all 7 aggregate functions covering null handling, retraction, boundary values, oversize bitmap, and validation errors
- Scala ITCase tests covering batch/streaming group-by, over-window, tumble window, and Table API aggregation scenarios

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): no
  • The public API, i.e., is any changed class annotated with @Public(Evolving): yes
  • The serializers: no
  • The runtime per-record code paths (performance sensitive): no
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
  • The S3 file system connector: no

Documentation

  • Does this pull request introduce a new feature? yes
  • If yes, how is the feature documented? JavaDocs

@dylanhz dylanhz marked this pull request as draft March 25, 2026 06:25
@dylanhz dylanhz changed the title Flink 39187 [FLINK-39187][table] Add core built-in aggregate functions for BITMAP Mar 25, 2026
@flinkbot
Copy link
Collaborator

flinkbot commented Mar 25, 2026

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@dylanhz dylanhz marked this pull request as ready for review March 25, 2026 09:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants