apache/druid · error · UnsupportedOperationException

Not implemented

Error message

Not implemented

What it means

NoopArrayOfDoublesSketchBufferAggregator is the buffer-based noop variant for the tuple sketch extension; it returns an empty sketch and deliberately implements no primitive accessors. getFloat throws UnsupportedOperationException('Not implemented') because the aggregator's output is a sketch object, not a float. It signals misuse of the aggregator in a numeric context.

Source

Thrown at extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/NoopArrayOfDoublesSketchBufferAggregator.java:58

  public void init(final ByteBuffer buf, final int position)
  {
  }

  @Override
  public void aggregate(final ByteBuffer buf, final int position)
  {
  }

  @Override
  public Object get(final ByteBuffer buf, final int position)
  {
    return emptySketch;
  }

  @Override
  public float getFloat(final ByteBuffer buf, final int position)
  {
    throw new UnsupportedOperationException("Not implemented");
  }

  @Override
  public long getLong(final ByteBuffer buf, final int position)
  {
    throw new UnsupportedOperationException("Not implemented");
  }

  @Override
  public void close()
  {
  }

  @Override
  public void inspectRuntimeShape(final RuntimeShapeInspector inspector)
  {
  }

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Use sketch post-aggregators (ArrayOfDoublesSketchToNumEntries, sketch estimators) instead of primitive accessors on the sketch column
  2. Verify the aggregation's output type is Sketch and route it through sketch-aware extraction
  3. Replace the aggregator with a numeric one if a float metric is actually needed

Example fix

// before
float v = bufferAggregator.getFloat(buf, pos); // throws
// after
Object sketch = bufferAggregator.get(buf, pos);
double v = ((ArrayOfDoublesSketch) sketch).getRetainedEntries();
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(bufAgg instanceof ArrayOfDoublesSketchBufferAggregator)) {
  // only then consider primitive accessors
}

Type guard

boolean supportsFloat(Aggregator agg) {
  return !(agg instanceof NoopArrayOfDoublesSketchAggregator);
}

Try / catch

try {
  return agg.getFloat(buf, pos);
} catch (UnsupportedOperationException e) {
  Object sketch = agg.get(buf, pos);
  return ((ArrayOfDoublesSketch) sketch).estimate();
}

Prevention

When it happens

Trigger: Calling getFloat(ByteBuffer, int) on this buffer aggregator — i.e. the query engine attempts to read a float metric from a sketch-typed aggregation result.

Common situations: Native/SQL queries applying float-typed accessors or post-aggregators to an ArrayOfDoublesSketch aggregation; copying a query pattern from a numeric aggregator to a sketch aggregator without adjusting accessors.

Related errors


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