{"record":{"id":"d54714a1e44317a0","repo":"apache/druid","slug":"unsupported-nested-type-s","errorCode":null,"errorMessage":"Unsupported nested type: [%s]","messagePattern":"Unsupported nested type: \\[(.+?)\\]","errorType":"exception","errorClass":"IllegalStateException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/nested/FieldTypeInfo.java","lineNumber":320,"sourceCode":"        break;\n      case ARRAY:\n        Preconditions.checkNotNull(type.getElementType(), \"ElementType must not be null\");\n        switch (type.getElementType().getType()) {\n          case STRING:\n            types |= STRING_ARRAY_MASK;\n            break;\n          case LONG:\n            types |= LONG_ARRAY_MASK;\n            break;\n          case DOUBLE:\n            types |= DOUBLE_ARRAY_MASK;\n            break;\n          default:\n            throw new ISE(\"Unsupported nested array type: [%s]\", type.asTypeString());\n        }\n        break;\n      default:\n        throw new ISE(\"Unsupported nested type: [%s]\", type.asTypeString());\n    }\n    return types;\n  }\n\n  public static Set<ColumnType> convertToSet(byte types)\n  {\n    final Set<ColumnType> theTypes = Sets.newHashSetWithExpectedSize(4);\n    if ((types & STRING_MASK) > 0) {\n      theTypes.add(ColumnType.STRING);\n    }\n    if ((types & LONG_MASK) > 0) {\n      theTypes.add(ColumnType.LONG);\n    }\n    if ((types & DOUBLE_MASK) > 0) {\n      theTypes.add(ColumnType.DOUBLE);\n    }\n    if ((types & STRING_ARRAY_MASK) > 0) {\n      theTypes.add(ColumnType.STRING_ARRAY);","sourceCodeStart":302,"sourceCodeEnd":338,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/nested/FieldTypeInfo.java#L302-L338","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before (older Druid reading newer segment)\n// ISE: Unsupported nested type: [ARRAY<COMPLEX>]\n// after: upgrade the cluster so reader version >= writer version,\n// or re-ingest with the older version's supported types","handlingStrategy":"validation","validationCode":"// before reading nested columns, check writer vs reader support\nColumnTypeInfo info = ColumnTypeInfo.getMetadata(colMetadata);\n// or: verify cluster version >= version that wrote the segment\nif (!SUPPORTED_NESTED_TYPES.contains(typeCode)) { throw new SkipSegmentException(...); }","typeGuard":"boolean isReadableNestedType(byte typeCode) {\n  return ColumnTypeInfo.values().length > 0 && java.util.Arrays.stream(ColumnTypeInfo.values())\n      .anyMatch(t -> t.getType() == typeCode);\n}","tryCatchPattern":"try {\n  types = FieldTypeInfo.add(existing, type);\n} catch (IllegalStateException e) {\n  if (e.getMessage().startsWith(\"Unsupported nested\")) {\n    log.warn(e, \"Segment uses unsupported nested type; skipping/upgrade required\");\n  } else throw e;\n}","preventionTips":["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"],"tags":["druid","segment","nested-column","type-mismatch","backward-compatibility"],"backgroundTag":"unsupported-enum-value","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}