apache/druid · error · IllegalStateException
Unsupported nested type: [%s]
Error message
Unsupported nested type: [%s]
What it means
FieldTypeInfo.add() builds the set of ColumnTypes encoded in a nested field's serialized type bitmap byte. Each byte value maps to a scalar or array type; any unmapped byte means the segment was written by a newer Druid version (or is corrupt) whose type code this version cannot interpret, so it throws an ISE rather than guessing.
Source
Thrown at processing/src/main/java/org/apache/druid/segment/nested/FieldTypeInfo.java:320
break;
case ARRAY:
Preconditions.checkNotNull(type.getElementType(), "ElementType must not be null");
switch (type.getElementType().getType()) {
case STRING:
types |= STRING_ARRAY_MASK;
break;
case LONG:
types |= LONG_ARRAY_MASK;
break;
case DOUBLE:
types |= DOUBLE_ARRAY_MASK;
break;
default:
throw new ISE("Unsupported nested array type: [%s]", type.asTypeString());
}
break;
default:
throw new ISE("Unsupported nested type: [%s]", type.asTypeString());
}
return types;
}
public static Set<ColumnType> convertToSet(byte types)
{
final Set<ColumnType> theTypes = Sets.newHashSetWithExpectedSize(4);
if ((types & STRING_MASK) > 0) {
theTypes.add(ColumnType.STRING);
}
if ((types & LONG_MASK) > 0) {
theTypes.add(ColumnType.LONG);
}
if ((types & DOUBLE_MASK) > 0) {
theTypes.add(ColumnType.DOUBLE);
}
if ((types & STRING_ARRAY_MASK) > 0) {
theTypes.add(ColumnType.STRING_ARRAY);View on GitHub (pinned to 9b90983fd2)
Solutions
- Upgrade Druid to a version that supports the nested type code in the segment (check the version that wrote the segment).
- Re-ingest the data with the older/compatible writer version to regenerate the column type metadata.
- Verify segment integrity; re-download or re-restore the segment if bytes are corrupted.
- If downgrading is intentional, drop or re-ingest columns using new nested types before downgrading.
Example fix
// before (older Druid reading newer segment) // ISE: Unsupported nested type: [ARRAY<COMPLEX>] // after: upgrade the cluster so reader version >= writer version, // or re-ingest with the older version's supported types
Defensive patterns
Strategy: validation
Validate before calling
// before reading nested columns, check writer vs reader support
ColumnTypeInfo info = ColumnTypeInfo.getMetadata(colMetadata);
// or: verify cluster version >= version that wrote the segment
if (!SUPPORTED_NESTED_TYPES.contains(typeCode)) { throw new SkipSegmentException(...); } Type guard
boolean isReadableNestedType(byte typeCode) {
return ColumnTypeInfo.values().length > 0 && java.util.Arrays.stream(ColumnTypeInfo.values())
.anyMatch(t -> t.getType() == typeCode);
} Try / catch
try {
types = FieldTypeInfo.add(existing, type);
} catch (IllegalStateException e) {
if (e.getMessage().startsWith("Unsupported nested")) {
log.warn(e, "Segment uses unsupported nested type; skipping/upgrade required");
} else throw e;
} Prevention
- Keep all Druid services on the same version as the writer before reading segments
- Never downgrade a cluster that has ingested with newer nested types
- Validate segment metadata after restores from deep storage
When it happens
Trigger: Reading a nested column (auto-type column / nested data format) whose serialized type-byte encodes a type (or nested-array type) unsupported by the running Druid version; corrupted type metadata bytes.
Common situations: Rolling upgrade/downgrade across Druid versions where a newer writer produced V4+ nested columns with new type codes; reading segments from a fork or patched build with custom type codes; segment file corruption.
Related errors
- Cannot merge columns of type[%s] and format[%s] and with [%s
- Unknown version
- Unknown version
- not a scalar in the dictionary
- Cannot deserialize type[%s] to an RoaringBitmap64Counter:
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/d54714a1e44317a0.
Report an issue: GitHub.