apache/druid · error · UnsupportedOperationException

Not implemented

Error message

Not implemented

What it means

HllSketchMergeAggregator aggregates HLL sketches and supports getDouble() as its numeric accessor; getFloat() is deliberately unimplemented because an HLL sketch's estimate is a double and a float representation would lose precision. Calling it always throws UnsupportedOperationException. Use getDouble() or the sketch accessor instead.

Source

Thrown at extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeAggregator.java:87

   * and Druid can call aggregate() and get() concurrently.
   * See https://github.com/druid-io/druid/pull/3956
   */
  @Override
  public synchronized Object get()
  {
    return HllSketchHolder.of(union.getResult(tgtHllType));
  }

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

  @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 getDouble() on the aggregator, or HllSketchHolder.getSketch() then estimate/getEstimate()
  2. Set the aggregation's type to "double" (or the sketch TYPE) instead of "float" in the query/spec
  3. In post-aggregators use the estimator/field accessor that reads doubles

Example fix

// before
float est = aggregator.getFloat();
// after
double est = aggregator.getDouble();
Defensive patterns

Strategy: validation

Try / catch

try { v = agg.getFloat(); } catch (UnsupportedOperationException e) { v = (float) agg.getDouble(); }

Prevention

When it happens

Trigger: Configuring an aggregation/post-aggregation that calls getFloat() on this aggregator, e.g. a float-typed expression or a numeric post-agg that selects float accessors over the sketch metric.

Common situations: Writing SQL or native queries where the engine expects a FLOAT column type; custom post-aggregators iterating numeric getters; mis-typed finalizer output types in the aggregation spec.

Related errors


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