apache/druid · error · UOE

makeDimensionSelector is not supported, column

Error message

makeDimensionSelector is not supported, column [%s] is [%s] typed and should only use makeColumnValueSelector

What it means

This AutoTypeColumnIndexer's column has a single, array-typed root literal value. Dimension selectors produce per-row String values and cannot represent arrays, so makeDimensionSelector throws UnsupportedOperationException; array columns must be read with makeColumnValueSelector, which yields the array object.

Solutions

  1. Read the column via ColumnSelectorFactory.makeColumnValueSelector instead of makeDimensionSelector.
  2. For grouping/aggregation semantics, use the array-aware query paths (e.g. ARRAY functions or unnest) rather than treating the array as a dimension.
  3. Unwrap the array into scalar rows at ingestion time (flatten the JSON array) if scalar dimension access is required.
  4. Update custom extensions/virtual columns that build selectors to handle array-typed columns.

Example fix

// before
DimensionSelector sel = columnSelectorFactory.makeDimensionSelector(spec);
// after
ColumnValueSelector<?> valSel = columnSelectorFactory.makeColumnValueSelector(spec.getOutputName());
Defensive patterns

Strategy: type-guard

Validate before calling

ColumnType t = indexer.getLogicalType();
if (t != null && t.isArray()) {
  throw new IllegalStateException("use makeColumnValueSelector for " + name);
}

Type guard

boolean isArrayTyped(ColumnCapabilities caps) {
  return caps != null && caps.getType().isArray();
}

Try / catch

try {
  return factory.makeDimensionSelector(spec);
} catch (UnsupportedOperationException e) {
  return adaptFromValueSelector(factory.makeColumnValueSelector(spec.getOutputName()), spec);
}

Prevention

When it happens

Trigger: Calling makeDimensionSelector on an auto-type column whose root value is a single array type (STRING_ARRAY, LONG_ARRAY, DOUBLE_ARRAY), e.g. from a query engine, filter, or grouping code that requests a dimension selector for an array-valued column.

Common situations: A query groups/filters on an array column as if it were a scalar dimension; a custom query plugin or virtual column builder assumes scalar columns; a schema change turned a column into an array type while old query code still selects it as a dimension.

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/9a48b05d3821360b. Report an issue: GitHub.

Appendix: source

Thrown at processing/src/main/java/org/apache/druid/segment/AutoTypeColumnIndexer.java:306

  }

  @Override
  public DimensionSelector makeDimensionSelector(
      DimensionSpec spec,
      IncrementalIndexRowHolder currEntry,
      IncrementalIndex.DimensionDesc desc
  )
  {
    final int dimIndex = desc.getIndex();
    if (fieldIndexers.size() == 0 && isConstant && !hasNestedData) {
      return DimensionSelector.constant(null, spec.getExtractionFn());
    }
    final ColumnValueSelector<?> rootLiteralSelector = getRootLiteralValueSelector(currEntry, dimIndex);
    if (rootLiteralSelector != null) {
      final FieldIndexer root = fieldIndexers.get(NestedPathFinder.JSON_PATH_ROOT);
      final ColumnType rootType = root.isSingleType() ? root.getTypes().getSingleType() : getLogicalType();
      if (rootType.isArray()) {
        throw new UOE(
            "makeDimensionSelector is not supported, column [%s] is [%s] typed and should only use makeColumnValueSelector",
            spec.getOutputName(),
            rootType
        );
      }
      if (spec.getExtractionFn() == null) {
        return new BaseSingleValueDimensionSelector()
        {
          @Nullable
          @Override
          protected String getValue()
          {
            return Evals.asString(rootLiteralSelector.getObject());
          }

          @Override
          public void inspectRuntimeShape(RuntimeShapeInspector inspector)
          {

View on GitHub (pinned to 9b90983fd2)