apache/druid · error · java.lang.UnsupportedOperationException

extractValue without an aggregator factory is not supported.

Error message

extractValue without an aggregator factory is not supported.

What it means

The ColumnValueSelector created by FixedBucketsHistogramSerde.makeColumnValueSelector without an AggregatorFactory throws UnsupportedOperationException from extractValue(InputRow, String). The serde can only extract histogram values when it knows the expected aggregator factory (to deserialize/validate); the no-factory overload is intentionally unsupported for this complex type.

Source

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

    return FixedBucketsHistogramAggregator.TYPE_NAME;
  }

  @Override
  public ComplexMetricExtractor getExtractor()
  {
    return new ComplexMetricExtractor()
    {
      @Override
      public Class<FixedBucketsHistogram> extractedClass()
      {
        return FixedBucketsHistogram.class;
      }

      @Nullable
      @Override
      public Object extractValue(InputRow inputRow, String metricName)
      {
        throw new UnsupportedOperationException("extractValue without an aggregator factory is not supported.");
      }

      @Override
      public FixedBucketsHistogram extractValue(InputRow inputRow, String metricName, AggregatorFactory agg)
      {
        Object rawValue = inputRow.getRaw(metricName);

        FixedBucketsHistogramAggregatorFactory aggregatorFactory = (FixedBucketsHistogramAggregatorFactory) agg;

        if (rawValue == null) {
          FixedBucketsHistogram fbh = new FixedBucketsHistogram(
              aggregatorFactory.getLowerLimit(),
              aggregatorFactory.getUpperLimit(),
              aggregatorFactory.getNumBuckets(),
              aggregatorFactory.getOutlierHandlingMode()
          );
          fbh.incrementMissing();
          return fbh;

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Use the three-argument extractValue(inputRow, metricName, AggregatorFactory) overload, supplying the FixedBucketsHistogramAggregatorFactory.
  2. Ensure ingestion paths that materialize column values pass the aggregator factory so the serde can decode base64/JSON histograms.
  3. If only raw values are needed, use inputRow.getRaw(metricName) instead of the selector's extractValue.

Example fix

// before
Object v = selector.extractValue(row, "myHist");
// after
Object v = selector.extractValue(row, "myHist", new FixedBucketsHistogramAggregatorFactory(...));
Defensive patterns

Strategy: try-catch

Try / catch

try {
  Object v = selector.extractValue(row, metricName);
} catch (UnsupportedOperationException e) {
  Object v = selector.extractValue(row, metricName, aggregatorFactory);
}

Prevention

When it happens

Trigger: Calling the two-argument extractValue(inputRow, metricName) on the selector produced by FixedBucketsHistogramSerde, or framework code that reads column values without passing the AggregatorFactory.

Common situations: Custom ingestion/stream-parsing code using the no-factory selector API against a fixedBucketsHistogram column; generic value-extraction utilities that ignore aggregator factories.

Related errors


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