apache/druid · error · java.lang.UnsupportedOperationException

Not implemented

Error message

Not implemented

What it means

NoopDoublesSketchBufferAggregator is a placeholder buffer aggregator used when a quantiles sketch aggregation cannot produce a numeric result. Its getFloat method unconditionally throws UnsupportedOperationException because a DoublesSketch binary value cannot be meaningfully read as a float. Druid calls getFloat when a query's final/post-aggregator output type is declared as FLOAT, which is unsupported for this aggregator.

Source

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

      int numRows,
      int[] positions,
      @Nullable int[] rows,
      int positionOffset
  )
  {
    // Nothing to do.
  }

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

  @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 relocate(int oldPosition, int newPosition, ByteBuffer oldBuffer, ByteBuffer newBuffer)
  {
    // Nothing to do.
  }

  @Override
  public void close()
  {
    // Nothing to do.

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Change the query's output/post-aggregator type to DOUBLE or use the appropriate sketch post-aggregator (e.g. quantilesDoublesSketchToQuantile) instead of reading the sketch as a float
  2. Do not call getFloat on a sketch aggregator; call get and deserialize the DoublesSketch object
  3. If this appears in ingestion, remove a wrongly-typed finalize/post-aggregation step on the sketch column

Example fix

// before
AggregatorFactory agg = new QuantilesDoublesSketchAggregatorFactory("sk", "val", 128);
PostAggregator post = new ArithmeticPostAggregator("out", "+", Collections.singletonList(new FieldAccessPostAggregator("sk"))); // resolved as FLOAT
// after
PostAggregator post = new QuantilesDoublesSketchToQuantilePostAggregator("out", new FieldAccessPostAggregator("sk"), 0.5);
Defensive patterns

Strategy: validation

Validate before calling

if (agg instanceof NoopDoublesSketchBufferAggregator) { throw new IllegalArgumentException("Use sketch post-aggregators, not FLOAT access, for quantiles sketch columns"); }

Type guard

boolean supportsFloat(Aggregator a) { return !(a instanceof NoopDoublesSketchBufferAggregator); }

Try / catch

try { value = agg.getFloat(buf, pos); } catch (UnsupportedOperationException e) { value = null; /* use agg.get() + post-aggregator */ }

Prevention

When it happens

Trigger: A query uses a quantiles sketch aggregator but requests the aggregated value as a float — e.g. a post-aggregator or SQL return type of FLOAT applied to the sketch column, or a numeric accessor invoked on the sketch output during result merge.

Common situations: Declaring a FLOAT output type for a sketch aggregator in native JSON queries; SQL type inference mapping a sketch post-aggregation to FLOAT; custom code that iterates buffer aggregators generically calling getFloat on every column.

Related errors


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