apache/druid · error · ISE
Unsupported expression type[%s]
Error message
Unsupported expression type[%s]
What it means
getTypeStrategy() switches on the ExpressionType's kind (LONG, DOUBLE, STRING, ARRAY, COMPLEX). Any other ExprType value has no TypeStrategy and triggers ISE 'Unsupported expression type[x]'. This is an internal invariant check — valid ExpressionTypes are always one of the handled kinds, so this indicates a malformed or future-version ExpressionType reached the factory.
Source
Thrown at processing/src/main/java/org/apache/druid/math/expr/ExpressionTypeFactory.java:121
break;
case DOUBLE:
strategy = TypeStrategies.DOUBLE;
break;
case STRING:
strategy = TypeStrategies.STRING;
break;
case ARRAY:
strategy = new TypeStrategies.ArrayTypeStrategy(expressionType);
break;
case COMPLEX:
TypeStrategy<?> complexStrategy = TypeStrategies.getComplex(expressionType.getComplexTypeName());
if (complexStrategy == null) {
throw new IAE("Cannot find strategy for type [%s]", expressionType.asTypeString());
}
strategy = complexStrategy;
break;
default:
throw new ISE("Unsupported expression type[%s]", expressionType.getType());
}
return strategy;
}
}
View on GitHub (pinned to 9b90983fd2)
Solutions
- Only pass ExpressionTypes produced by ExpressionTypeFactory/ExpressionType constants into getTypeStrategy().
- Align all Druid module versions so ExprType enums are consistent.
- If a new ExprType was added by an extension, register a corresponding TypeStrategy and extend the switch upstream.
- Catch ISE, log expressionType.getType(), and trace where the malformed type was constructed.
Defensive patterns
Strategy: type-guard
Validate before calling
ExprType kind = exprType.getType();
if (kind != ExprType.LONG && kind != ExprType.DOUBLE && kind != ExprType.STRING
&& kind != ExprType.ARRAY && kind != ExprType.COMPLEX) {
throw new IllegalStateException("No TypeStrategy for ExprType " + kind);
} Type guard
boolean hasTypeStrategy(ExpressionType t) {
switch (t.getType()) {
case LONG: case DOUBLE: case STRING: case ARRAY: case COMPLEX: return true;
default: return false;
}
} Try / catch
try {
TypeStrategy<?> s = ExpressionTypeFactory.getInstance().getTypeStrategy(exprType);
} catch (IllegalStateException e) {
log.error("Unsupported ExprType %s", exprType.getType()); throw e;
} Prevention
- Only pass factory-produced ExpressionTypes to getTypeStrategy()
- Register a TypeStrategy for any new ExprType added by extensions
- Keep ExprType definitions version-aligned across modules
When it happens
Trigger: Calling ExpressionTypeFactory.getInstance().getTypeStrategy(exprType) with an ExpressionType whose getType() is not LONG/DOUBLE/STRING/ARRAY/COMPLEX (hand-constructed, corrupted, or from an incompatible Druid version).
Common situations: Custom expression extensions introducing new ExprType values without registering a strategy; deserializing expression types across mismatched Druid versions; test code constructing ExpressionType directly.
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
- Unsupported value type[%s]
- Unsupported expression type[%s]
- FLOAT types are not supported natively by Druid expressions
- Unsupported unknown value type
- Cannot implicitly cast [%s] to [%s]
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/1f07a87405c99fe6.
Report an issue: GitHub.