apache/druid · error · java.lang.UnsupportedOperationException

ApproximateHistogramFoldingBufferAggregator does not…

Error message

ApproximateHistogramFoldingBufferAggregator does not support getDouble()

What it means

ApproximateHistogramFoldingBufferAggregator aggregates ApproximateHistogram objects, which expose no single double value, so getDouble() is an unconditionally unsupported sentinel throwing UnsupportedOperationException. It fires when the histogram metric is read via the primitive double accessor instead of get().

Solutions

  1. Use get() plus histogram post-aggregators (e.g. quantile, min/max, custom bucket evaluators) to read results
  2. Do not configure this aggregator as a double-typed metric in queries or downstream consumers
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingBufferAggregator.java:78 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/ApproximateHistogramFoldingBufferAggregator.java:78

    return innerAggregator.get(buf, position);
  }

  @Override
  public float getFloat(ByteBuffer buf, int position)
  {
    throw new UnsupportedOperationException("ApproximateHistogramFoldingBufferAggregator does not support getFloat()");
  }

  @Override
  public long getLong(ByteBuffer buf, int position)
  {
    throw new UnsupportedOperationException("ApproximateHistogramFoldingBufferAggregator does not support getLong()");
  }

  @Override
  public double getDouble(ByteBuffer buf, int position)
  {
    throw new UnsupportedOperationException("ApproximateHistogramFoldingBufferAggregator does not support getDouble()");
  }

  @Override
  public void close()
  {
    // no resources to cleanup
  }

  @Override
  public void inspectRuntimeShape(RuntimeShapeInspector inspector)
  {
    inspector.visit("selector", selector);
  }
}

View on GitHub (pinned to 9b90983fd2)