apache/druid · error · UnsupportedOperationException

Not implemented

Error message

Not implemented

What it means

Bitmap64ExactCountMergeAggregator.getFloat() is an intentionally unimplemented stub. The merge-side aggregator merges Roaring64Bitmaps and exposes the merged bitmap via get(); float scalar access is not part of its supported surface, so getFloat() always throws UnsupportedOperationException("Not implemented").

Source

Thrown at extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeAggregator.java:54

  }

  @Override
  public void aggregate()
  {
    bitmap.fold(selector.getObject());
  }

  @Nullable
  @Override
  public Object get()
  {
    return bitmap;
  }

  @Override
  public float getFloat()
  {
    throw new UnsupportedOperationException("Not implemented");
  }

  @Override
  public long getLong()
  {
    throw new UnsupportedOperationException("Not implemented");
  }

  @Override
  public void close()
  {
    bitmap = null;
  }
}

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Obtain the count via the aggregator's dedicated accessor or bitmap.getLongCardinality() from get().
  2. Declare/consume the aggregation result as LONG (cardinality), not FLOAT.
  3. Dispatch on ValueType before calling scalar getters, skipping non-numeric aggregations.
  4. Implement getFloat() in the extension if float exposure is required.

Example fix

// before
float v = mergeAggregator.getFloat();

// after
long v = mergeAggregator.getLong(); // cardinality accessor provided by the merge aggregator
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(mergeAggregator.get() instanceof Roaring64Bitmap)) { throw new IllegalStateException("unexpected aggregation output"); }

Type guard

boolean isBitmapAggregator(Aggregator a) { return a != null && a.get() instanceof Roaring64Bitmap; }

Try / catch

try { v = mergeAggregator.getFloat(); } catch (UnsupportedOperationException e) { v = (float) ((Roaring64Bitmap) mergeAggregator.get()).getLongCardinality(); }

Prevention

When it happens

Trigger: A selector loop or post-aggregator calls getFloat() on the merge aggregator's output column instead of the cardinality accessor / get().

Common situations: Custom post-aggregators over BITMAP64_EXACT_COUNT results assuming numeric float output; generic value-selector code that tries getDouble/getFloat/getLong in sequence; test code exercising the Aggregator interface exhaustively.

Related errors


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/079a669a06fa1295. Report an issue: GitHub.