apache/druid · error · java.lang.UnsupportedOperationException

Not implemented

Error message

Not implemented

What it means

NoopDoublesSketchAggregator discards sketch data (used where a sketch column exists but results are not needed) and only supports get()/reset(). Numeric accessors getFloat/getLong/getDouble have no meaning for a sketch aggregate, so getFloat() throws UnsupportedOperationException('Not implemented').

Source

Thrown at extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/NoopDoublesSketchAggregator.java:45

  public Object get()
  {
    return DoublesSketchOperations.EMPTY_SKETCH;
  }

  @Override
  public void aggregate()
  {
  }

  @Override
  public void close()
  {
  }

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

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

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Use a scalar aggregation (doubleSum/doubleMin/etc.) on a numeric column instead of the noop sketch aggregator if you need float output.
  2. Wrap the sketch aggregation in a proper sketch post-aggregator to obtain values.
  3. Remove any query element that requests FLOAT output from the sketch column.

Example fix

// before
{"type":"quantilesDoublesSketch", "fieldName":"x"} + FLOAT projection -> getFloat() throws
// after
{"type":"doubleSum", "fieldName":"x"} // if a numeric value is actually wanted
Defensive patterns

Strategy: validation

Validate before calling

if ("quantilesDoublesSketch".equals(aggSpec.get("type")) && expectsNumericColumn(query)) { throw new IllegalArgumentException("Sketch aggregates cannot be read as numeric columns"); }

Type guard

static boolean expectsNumericMetric(Object col) { return col instanceof String && NUMERIC_METRIC_NAMES.contains(col); }

Try / catch

try { row.getFloat("col"); } catch (UnsupportedOperationException e) { /* re-query with scalar aggregator or post-agg */ }

Prevention

When it happens

Trigger: Druid engine calling getFloat() on the noop aggregator — typically when the query expects a float metric from the aggregation, or a post-aggregator/SQL projection coerces the sketch column to FLOAT.

Common situations: Misconfigured queries treating the sketch-typed column as a numeric metric; SQL planner coercion of the sketch column to a FLOAT/REAL type.

Related errors


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