apache/druid · error · IllegalStateException
No serde for complexTypeName[%s], cannot write column [%s]
Error message
No serde for complexTypeName[%s], cannot write column [%s]
What it means
After obtaining the complex type name, makeComplexWriter resolves it to a ComplexMetricSerde via ComplexMetrics.getSerdeForType. If no serde is registered for that name, serialization is impossible and an ISE is thrown. Complex serdes must be registered in ComplexMetrics before any column of that type is read or written.
Source
Thrown at processing/src/main/java/org/apache/druid/frame/field/FieldWriters.java:202
{
final ColumnValueSelector<?> selector =
TypeCastSelectors.makeColumnValueSelector(selectorFactory, columnName, ColumnType.DOUBLE_ARRAY);
return NumericArrayFieldWriter.getDoubleArrayFieldWriter(selector, frameType);
}
private static FieldWriter makeComplexWriter(
final ColumnSelectorFactory selectorFactory,
final String columnName,
@Nullable final String columnTypeName
)
{
if (columnTypeName == null) {
throw new ISE("No complexTypeName, cannot write column [%s]", columnName);
}
final ComplexMetricSerde serde = ComplexMetrics.getSerdeForType(columnTypeName);
if (serde == null) {
throw new ISE("No serde for complexTypeName[%s], cannot write column [%s]", columnTypeName, columnName);
}
final ColumnValueSelector<?> selector =
TypeCastSelectors.makeColumnValueSelector(selectorFactory, columnName, ColumnType.ofComplex(columnTypeName));
return new ComplexFieldWriter(serde, selector);
}
}
View on GitHub (pinned to 9b90983fd2)
Solutions
- Load the Druid extension that provides the complex metric type (e.g. druid-datasketches) on the affected service.
- Verify the complexTypeName spelling matches the registered serde name.
- Register the custom ComplexMetricSerde in ComplexMetrics before frame writing.
- Drop/re-ingest segments referencing unknown complex types.
Example fix
// before druid.extensions.loadList=["druid-s3-extensions"] // datasketches ext missing -> No serde for complexTypeName[quantilesDoublesSketch] // after druid.extensions.loadList=["druid-s3-extensions", "druid-datasketches"]
Defensive patterns
Strategy: validation
Validate before calling
// Java: verify serde is registered before writing
if (ComplexMetrics.getSerdeForType(complexTypeName) == null) {
throw new IllegalStateException("Serde not registered for " + complexTypeName + " - load the extension");
} Try / catch
try {
FieldWriters.create(...);
} catch (IllegalStateException e) {
if (e.getMessage().startsWith("No serde for complexTypeName")) {
throw new IllegalStateException("Load the extension providing " + complexTypeName, e);
}
throw e;
} Prevention
- Load the same extensions on every node (druid.extensions.loadList) so serdes are always registered.
- Confirm complex type names in ingestion specs match registered serde names.
When it happens
Trigger: Frame-writing a COMPLEX column whose complexTypeName (e.g. a custom aggregator type or one from an unloaded extension) is not registered in ComplexMetrics, so ComplexMetrics.getSerdeForType returns null.
Common situations: Querying/compacting segments written by an extension (e.g. datasketches) that is not loaded on this Druid node; typo'd complex type name in ingestion config; custom ComplexMetricSerde not registered on the query runner.
Understand the failure class
Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.
Related errors
- No complexTypeName, cannot write column [%s]
- extractValue without an aggregator factory is not supported.
- Unknown type:
- Object is not of a type[%s] that can be deserialized to Hype
- Emit called unexpectedly before service start
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/4ad8e245778bcd74.
Report an issue: GitHub.