apache/druid · error · java.lang.UnsupportedOperationException

FixedBucketsHistogramAggregator does not support getLong()

Error message

FixedBucketsHistogramAggregator does not support getLong()

What it means

Guard thrown by FixedBucketsHistogramAggregator.getLong(): the aggregator produces a FixedBucketsHistogram object, not a numeric scalar, so long-typed access is deliberately unsupported. It fires when a query's output type or an enclosing aggregation requires a long primitive from this aggregator; use the histogram via get() or a double/float-enabled wrapper instead.

Solutions

  1. Access the histogram via get()/ObjectResult instead of getLong().
  2. Use a numeric aggregator if a long result is required.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at extensions-core/histogram/src/main/java/org/apache/druid/query/aggregation/histogram/FixedBucketsHistogramAggregator.java:88 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/7f5c93adf3521643. Report an issue: GitHub.

Appendix: source

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

  }

  @Nullable
  @Override
  public Object get()
  {
    return histogram;
  }

  @Override
  public float getFloat()
  {
    throw new UnsupportedOperationException("FixedBucketsHistogramAggregator does not support getFloat()");
  }

  @Override
  public long getLong()
  {
    throw new UnsupportedOperationException("FixedBucketsHistogramAggregator does not support getLong()");
  }

  @Override
  public double getDouble()
  {
    throw new UnsupportedOperationException("FixedBucketsHistogramAggregator does not support getDouble()");
  }

  @Override
  public boolean isNull()
  {
    return false;
  }

  @Override
  public void close()
  {

View on GitHub (pinned to 9b90983fd2)