Skip to content

[flink] Fix ClassNotFoundException for RoaringBitmap in shaded Flink connector JAR #3980

Description

@pbanakar

Search before asking

  • I searched in the issues and found nothing similar.

Fluss version

main (development)

Please describe the bug 🐞

ClassNotFoundException: org.roaringbitmap.RoaringBitmap when using FlussCatalog bitmap functions (rb_build_agg, rb_cardinality, rb_or_agg) introduced in FIP-37.

Steps to reproduce:

  1. Build apache/fluss-quickstart-flink from main branch
  2. Start environment with docker compose
  3. Enter Flink SQL Client
  4. CREATE CATALOG fluss_catalog WITH ('type' = 'fluss', 'bootstrap.servers' = 'coordinator-server:9123');
  5. USE CATALOG fluss_catalog;
  6. Run any SQL using rb_build_agg() or rb_cardinality()

Error:
java.lang.ClassNotFoundException: org.roaringbitmap.RoaringBitmap

Root cause confirmed:
RoaringBitmap is declared as a compile-scope dependency in fluss-flink-common/pom.xml but is NOT listed in the maven-shade-plugin artifactSet in fluss-flink-1.20/pom.xml.

The shade plugin only includes:

  • org.apache.fluss:fluss-flink-common
  • org.apache.fluss:fluss-client

So org.roaringbitmap:RoaringBitmap is dropped from the final JAR.

Confirmed by: jar tf fluss-flink-1.20-1.0-SNAPSHOT.jar | grep -i roaring→ returns only Fluss wrapper classes, no org/roaringbitmap/* classes

Solution

Add org.roaringbitmap:RoaringBitmap to the artifactSet includes in the maven-shade-plugin configuration in fluss-flink-1.20/pom.xml (and fluss-flink-1.18, fluss-flink-1.19, fluss-flink-2.2):

org.roaringbitmap:RoaringBitmap

Are you willing to submit a PR?

  • I'm willing to submit a PR!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions