apache/druid · error · UnsupportedColumnTypeException
Cannot handle column [%s] with type [%s]
Error message
Cannot handle column [%s] with type [%s]
What it means
FieldWriters.create dispatches on the column type to build writers; supported scalar and scalar-array types return writers, but some branches (e.g. COMPLEX inside the array switch, and the outer default) throw UnsupportedColumnTypeException ('Cannot handle column [%s] with type [%s]'). Error [989] is the outer default: a top-level type the frame writer layer cannot write.
Source
Thrown at processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:98
case STRING:
return makeStringWriter(columnSelectorFactory, columnName, removeNullBytes);
case COMPLEX:
return makeComplexWriter(columnSelectorFactory, columnName, columnType.getComplexTypeName());
case ARRAY:
switch (columnType.getElementType().getType()) {
case STRING:
return makeStringArrayWriter(columnSelectorFactory, columnName, removeNullBytes);
case LONG:
return makeLongArrayWriter(columnSelectorFactory, columnName);
case FLOAT:
return makeFloatArrayWriter(columnSelectorFactory, columnName, frameType);
case DOUBLE:
return makeDoubleArrayWriter(columnSelectorFactory, columnName, frameType);
case ARRAY:
case COMPLEX:
throw new UnsupportedColumnTypeException(columnName, columnType);
}
default:
throw new UnsupportedColumnTypeException(columnName, columnType);
}
}
private static FieldWriter makeLongWriter(
final ColumnSelectorFactory selectorFactory,
final String columnName
)
{
final ColumnValueSelector<?> selector =
TypeCastSelectors.makeColumnValueSelector(selectorFactory, columnName, ColumnType.LONG);
return LongFieldWriter.forPrimitive(selector);
}
private static FieldWriter makeFloatWriter(
final ColumnSelectorFactory selectorFactory,View on GitHub (pinned to 9b90983fd2)
Solutions
- Read the reported type; if it is COMPLEX, avoid routing complex-metric columns through frame writing or convert them to a serializable representation.
- Cast/derive supported columns (LONG/FLOAT/DOUBLE/STRING/arrays of those) before the frame-writing stage.
- Align Druid versions so any newly supported types are available on all nodes.
- Extend FieldWriters/FieldReaders together if adding support for a new type.
Example fix
// before SELECT sketch_col FROM ... -- complex column hits frame writer // after SELECT APPROX_QUANTILE_DS(sketch_col, 0.5) AS p50 FROM ... -- aggregate to a supported scalar before shuffle
Defensive patterns
Strategy: validation
Validate before calling
if (columnType != null && columnType.getType() == ValueType.COMPLEX) { throw new IllegalStateException("complex column " + columnName + " not frame-writable; aggregate or convert first"); } Try / catch
try { FieldWriters.create(factory, name, t, false); } catch (UnsupportedColumnTypeException e) { /* rewrite query to convert the column to a supported type */ } Prevention
- Aggregate complex-metric columns to scalars before shuffle stages
- Cast unsupported types to supported ones upstream
- Keep writer and reader type support in sync with the same Druid version
When it happens
Trigger: Calling FieldWriters.create with a ColumnType whose top-level type is not handled by the switch — for instance a COMPLEX column (hit in the array-switch COMPLEX arm) or any unknown/newer top-level type — when writing frames.
Common situations: MSQ work involving complex-metric columns that cannot be shuffled as frames; new column types introduced by upgrades but not yet supported by the frame writer; extension-provided types routed into generic frame writing.
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
- Cannot handle column [%s] with type [%s]
- Cannot handle column [%s] with unknown type
- Unsupported column type[%s]
- Aggregation [%s] does not support column [%s] of type [%s].
- endFrame[%,d] > numFrames[%,d]
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/ed88489b51cc5e95.
Report an issue: GitHub.