You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@fluss.apache.org by Prajwal Banakar <pr...@gmail.com> on 2026/09/29 07:08:03 UTC

[DISCUSS] FIP-XX: Bridge Native BITMAP Type from FLIP-556

Hi everyone,

As a follow-up to FIP-37, I would like to extend the work and start a
discussion on introducing native BITMAP type support in Apache Fluss.

Background

FIP-37 deferred the BITMAP type because "pending FLIP-556 (Introduce BITMAP
Data Type)  availability in Apache Flink." FLIP-556 has since been resolved
and merged into Flink 2.3.0 (FLINK-38852). Fluss already has a
fluss-flink-2.3 module and BitmapType.class is available in
flink-table-common-2.3.0 on the classpath, so the prerequisite appears to
be met.

Proposed Solution

Users would be able to declare bitmap columns as BITMAP instead of BYTES,
mapped to the existing rbm32 storage.

For example:

CREATE TABLE page_uv (
    page_id   INT,
    uv_bitmap BITMAP,
    PRIMARY KEY (page_id) NOT ENFORCED
) WITH (
    'table.merge-engine'   = 'aggregation',
    'fields.uv_bitmap.agg' = 'rbm32'
);

The rb_ functions from FIP-37 would accept and return BITMAP natively in
the Flink 2.3 path, enabling in-memory object passing between operators
without serialize/deserialize overhead at each step, the primary benefit
mentioned when deferring this in FIP-37.

Codebase Analysis

Looking at the current state of the codebase, the scope includes the
following:

1.  Unsupported Keyword: BITMAP is currently listed in
DataTypeParser.UnsupportedKeyword, raising an explicit error in DDL.
Supporting it requires removing it from UnsupportedKeyword and adding it as
a supported keyword.
2.  Type System: A native Fluss BitmapType would need to be added to
DataTypeRoot and DataTypeVisitor, both of which are @PublicStable.
DataTypeVisitor currently has 19 abstract visit() methods, so adding
visit(BitmapType) would break external implementors.
3.  Flink Connector: FlinkTypeToFlussType in fluss-flink-common extends
LogicalTypeDefaultVisitor and currently has no BitmapType case. Since
fluss-flink-common compiles against Flink 1.20 (where BitmapType does not
exist), BitmapType handling would need to live in a 2.3-specific subclass
in fluss-flink-2.3/adapter/, following the pattern of
TypeInformationAdapter and SchemaAdapter.
4.  Serialization: FLIP-556's Bitmap.toBytes() uses the same standard
32-bit RoaringBitmap binary format as FIP-37's BitmapUtils, so no
conversion is needed at the wire level.

Questions for Community Input

1.  DataTypeVisitor Breaking Change: Since DataTypeVisitor is
@PublicStable, adding visit(BitmapType) breaks external implementors. Is
the preferred approach a default method throwing
UnsupportedOperationException, an abstract base class, or deferring until
the next major version?
2.  DataTypeRoot: DataTypeRoot is also @PublicStable. Is adding BITMAP
acceptable for 1.1, or does this require a major version?
3.  Simpler Alternative Scope: Should we handle this in two steps, first
allowing BITMAP as DDL syntax that maps directly to BytesType internally
(avoiding breaking changes to DataTypeVisitor and DataTypeRoot), and
deferring a true Fluss-native BitmapType to a follow-on FIP or major
version?
4.  Backward Compatibility: My assumption is that existing BYTES columns
with rbm32 will continue working unchanged. Are there any other
considerations?
5.  rb_ Function Overloads: Should the existing rb_ functions from FIP-37
be updated to accept BITMAP inputs in the 2.3 path, or is that out of scope
for this FIP?

On rb64_

I will keep the 64-bit function family as a separate discussion, as
FLIP-556 also deferred 64-bit support for serialization standardization
reasons.

I will hold off on drafting a formal FIP Confluence page until there is
clarity on questions 1 and 2. Looking forward to your thoughts!

Best regards,
Prajwal Banakar