apache/druid · error · org.apache.druid.java.util.common.IAE

cannot vectorize fixed bucket histogram aggregation for type

Error message

cannot vectorize fixed bucket histogram aggregation for type %s

What it means

FixedBucketsHistogramAggregatorFactory.factorizeVector() throws this IllegalArgumentException when vectorized query execution is requested but the input column's capabilities do not correspond to a type that the vector engine can process for this aggregator (i.e. not a string/serialized-histogram column it recognizes). Druid's vectorization engine only supports aggregators it has explicit vector implementations for, so the factory refuses to produce a VectorAggregator for unsupported column types instead of silently producing wrong results.

Source

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

  }

  @Override
  public VectorAggregator factorizeVector(VectorColumnSelectorFactory columnSelectorFactory)
  {
    ColumnCapabilities capabilities = columnSelectorFactory.getColumnCapabilities(fieldName);
    if (null == capabilities) {
      throw new IAE("could not find the column type for column %s", fieldName);
    }
    if (capabilities.isNumeric()) {
      return new FixedBucketsHistogramVectorAggregator(
          columnSelectorFactory.makeValueSelector(fieldName),
          lowerLimit,
          upperLimit,
          numBuckets,
          outlierHandlingMode
      );
    } else {
      throw new IAE("cannot vectorize fixed bucket histogram aggregation for type %s", capabilities.asTypeString());
    }
  }

  @Override
  public boolean canVectorize(ColumnInspector columnInspector)
  {
    ColumnCapabilities capabilities = columnInspector.getColumnCapabilities(fieldName);
    return capabilities != null && capabilities.isNumeric();
  }

  @Override
  public Comparator getComparator()
  {
    return FixedBucketsHistogramAggregator.COMPARATOR;
  }

  @Nullable
  @Override

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Disable vectorization for the query: set query context 'enableVectorize': false (or change druid.query.vectorize default).
  2. Verify the input column is a STRING column containing base64-encoded FixedBucketsHistogram values; fix the ingestion spec column type if not.
  3. Check capabilities.asTypeString() in the message to see what type the column actually is and align the aggregator/ingestion with that type.
  4. If the type should be supported, upgrade Druid; newer versions add vectorization support for more column types.

Example fix

// before: query context
{"aggregations": {"type": "fixedBucketsHistogram", ...}, "context": {"enableVectorize": true}}
// after
{"aggregations": {"type": "fixedBucketsHistogram", ...}, "context": {"enableVectorize": false}}
Defensive patterns

Strategy: validation

Validate before calling

ColumnCapabilities caps = columnInspector.getColumnCapabilities(columnName);
if (caps == null || !"STRING".equals(caps.getType().toString())) {
  // disable vectorization or fix column type before issuing the query
  context.put("enableVectorize", false);
}

Type guard

boolean canVectorizeHistogram(ColumnInspector col, String name) {
  ColumnCapabilities c = col.getColumnCapabilities(name);
  return c != null && c.getType().equals(ColumnType.STRING);
}

Try / catch

try {
  aggregator = factory.factorizeVector(columnSelectorFactory);
} catch (IllegalArgumentException e) {
  if (e.getMessage().startsWith("cannot vectorize")) {
    aggregator = factory.factorize(columnSelectorFactory); // non-vector fallback
  } else throw e;
}

Prevention

When it happens

Trigger: Running a query with a fixed-buckets histogram aggregator with vectorization enabled (druid.query.vectorize default or query context enableVectorize=true) against a column whose ColumnCapabilities type is not the expected string/serialized histogram type, e.g. a numeric or complex column the vectorizer cannot handle.

Common situations: Users point the histogram aggregator at a numeric column (long/double) instead of a string column holding base64-encoded FixedBucketsHistogram objects, or enable vectorization on a datasource where the histogram column was ingested with an unexpected type.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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