apache/druid · error · org.apache.druid.java.util.common.IAE
Dimension selector is currently unsupported for
Error message
Dimension selector is currently unsupported for [%s]
What it means
VariantColumn.makeDimensionSelector refuses to build a DimensionSelector when the column has no known variant types (variantTypes == null) and its logical type is an array. Array-only variant columns must be accessed through array/object selectors, not the dimension-selector API, so the column throws IAE immediately.
Solutions
- Use UNNEST or SQL array functions (ARRAY_CONTAINS, ARRAY_OVERLAP, etc.) instead of grouping on the raw array
- Use a native array filter (filter selector) rather than a dimension selector
- Ensure the column's type info was ingested so variantTypes is populated for mixed-type columns
- Rewrite the native query to use an object/vector selector path for the array column
Example fix
// before DimensionSelector sel = column.makeDimensionSelector(offset, extractionFn); // array column // after Object val = objectSelector.getObject(); then use array-aware processing or UNNEST in SQL
Defensive patterns
Strategy: validation
Validate before calling
if (column.getLogicalType().isArray()) { /* do not create a dimension selector; use array/object selector */ } Type guard
static boolean canMakeDimensionSelector(VariantColumn c) { return !(c.getLogicalType().isArray()); } Try / catch
try { sel = column.makeDimensionSelector(offset, fn); } catch (IAE e) { if (e.getMessage().contains("Dimension selector is currently unsupported")) { /* fall back to object selector */ } else { throw e; } } Prevention
- Never group or filter directly on ARRAY-typed nested columns via dimension specs
- Use UNNEST/array SQL functions for arrays
- Ensure ingestion records variantTypes so mixed-type columns get selector support
When it happens
Trigger: Calling makeDimensionSelector (via dimensionSelector) on a variant column whose logicalType is an array (e.g. ARRAY<STRING>) and whose variantTypes was not populated, e.g. from a query plan or cursor that selects the array column as a group-by dimension.
Common situations: Group-by or dimension-filtered queries referencing an ARRAY column directly; native queries using a dimension spec on an array-typed nested field; SQL that doesn't apply UNNEST or array functions before grouping.
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
- Multi-value row not supported
- Query type ' ' does not support returning results as arrays
- Aggregator[ ] cannot vectorize
- AppenderatorsManager methods should only called by services…
- ApproximateHistogramBufferAggregator does not support…
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/2caed8c57cb277cb.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java:382
@Override
public int getCardinality()
{
if (logicalType.isArray() && variantTypes == null) {
return arrayDictionary.size();
}
// this probably isn't correct if we expose this as a multi-value dimension instead of an array, which would leave
// the array dictionary out of this computation
return stringDictionary.size() + longDictionary.size() + doubleDictionary.size() + arrayDictionary.size();
}
@Override
public DimensionSelector makeDimensionSelector(
ReadableOffset offset,
@Nullable ExtractionFn extractionFn
)
{
if (variantTypes == null && logicalType.isArray()) {
throw new IAE("Dimension selector is currently unsupported for [%s]", logicalType);
}
// copy everywhere all the time
class StringDimensionSelector extends AbstractDimensionSelector
implements SingleValueHistoricalDimensionSelector, IdLookup
{
private final SingleIndexedInt row = new SingleIndexedInt();
@Override
public IndexedInts getRow()
{
row.setValue(getRowValue());
return row;
}
public int getRowValue()
{
return encodedValueColumn.get(offset.getOffset());
}View on GitHub (pinned to 9b90983fd2)