fluss icon indicating copy to clipboard operation
fluss copied to clipboard

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

Open pbanakar opened this issue 3 months ago • 0 comments

Search before asking

  • [x] 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?

  • [x] I'm willing to submit a PR!

pbanakar avatar Aug 13 '26 10:08 pbanakar