apache/druid · error · IllegalStateException
Unsupported nested array type
Error message
Unsupported nested array type: [%s]
What it means
FieldTypeInfo.add maps a nested value type to its array-type bitmask; only STRING/LONG/DOUBLE (and their ARRAY forms) are supported. Encountering an array of an unsupported type (e.g. complex/array-of-arrays beyond supported set) in the default branch throws ISE 'Unsupported nested array type'.
Solutions
- Flatten or remove nested-of-nested arrays in the input data before ingestion
- Cast array elements to supported scalar types (string/long/double) during ingestion
- Upgrade to a Druid version supporting the desired nested array type
- Guard the ingestion spec with transforms/filtered aggregations that skip unsupported array types
Example fix
// before
// input: {"tags": [["a","b"], ["c"]]} // array of arrays
// after
// transform to flat array
"transforms": [{"type": "expression", "name": "tags", "expression": "array_concat(tag0, tag1)"}] Defensive patterns
Strategy: validation
Validate before calling
for (Object v : list) { ValueType t = ValueType.fromRawType(v); if (!(t == ValueType.STRING || t == ValueType.LONG || t == ValueType.DOUBLE)) throw new IllegalArgumentException("Unsupported array element type " + t); } Type guard
boolean supportedArrayType(Object v) { return v instanceof List && !((List<?>) v).isEmpty() && (v.toString().startsWith("[") ) && !firstElementIsComplex((List<?>) v); } Try / catch
try { types = fieldTypeInfo.add(type, types); } catch (ISE e) { log.warn("Skipping unsupported nested array type: %s", e.getMessage()); return nullTypeMask(); } Prevention
- Normalize/flatten nested arrays in ingestion transforms
- Use filters or casts to keep array element types scalar
- Test ingestion specs against sample data containing complex arrays
When it happens
Trigger: Collecting field type info while ingesting nested data when an array element's ValueType falls through the switch's default case — e.g. nested arrays, arrays of complex objects, or future/unknown types.
Common situations: Ingesting JSON with arrays containing objects/arrays into a nested column on a Druid version without support for that array type; type inference producing unexpected ValueType from user data.
Related errors
- Cannot make array element selector for path
- Multi-value row not supported
- Aggregator[ ] cannot vectorize
- AppenderatorsManager methods should only called by services…
- ApproximateHistogramAggregator does not support getFloat()
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/dc99e610df9145d7.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/segment/nested/FieldTypeInfo.java:316
types |= LONG_MASK;
break;
case DOUBLE:
types |= DOUBLE_MASK;
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) {View on GitHub (pinned to 9b90983fd2)