apache/druid · error · IllegalArgumentException
Invalid value[ ] for[ ]
Error message
Invalid value[%s] for[%s]
What it means
DeferExpressionDimensions is an enum of deferred group-by dimension selector modes keyed by JSON name. fromString throws IAE when the supplied jsonName matches none of the enum values, i.e. an unknown value for the groupByEnableDeferredSelector-style config key.
Solutions
- Use one of the exact accepted jsonName values for the key (see DeferExpressionDimensions.values()).
- Read the enum source to list valid values, and validate config input before submitting queries.
- If upgrading, migrate old context values to the current enum names.
Example fix
// before
context.put("groupByEnableDeferredSelector", "yes");
// after
context.put("groupByEnableDeferredSelector", DeferExpressionDimensions.<VALUE>.getJsonName()); // e.g. a valid enum jsonName Defensive patterns
Strategy: validation
Validate before calling
boolean ok = Arrays.stream(DeferExpressionDimensions.values()).anyMatch(v -> v.getJsonName().equals(jsonName));
Try / catch
try { mode = DeferExpressionDimensions.fromString(jsonName); } catch (IllegalArgumentException e) { mode = DEFAULT; } Prevention
- Use the enum constant instead of a raw string when setting the context value
- Validate config values against the enum's jsonName list
- Re-check accepted values when upgrading Druid versions
When it happens
Trigger: Setting the group-by query context/config key controlling deferred expression dimensions to a string other than the accepted names (e.g. a typo or "true"/"false" instead of the enum's jsonName values).
Common situations: Configuration typos in query context or GroupByQueryConfig; behavior changes across Druid versions where accepted values changed.
Understand the failure class
Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.
Related errors
- buffer for list is too small, was
- Cannot simultaneously replace and append to existing…
- Conflicting segment granularities found
- druid.indexer.runner.javaOptsArray in context of task: X…
- Expected key [ ] to be referring to one of the values [ ]…
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/983bd67e77b93b9e.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/query/groupby/DeferExpressionDimensions.java:149
public static final String JSON_KEY = "deferExpressionDimensions";
private final String jsonName;
DeferExpressionDimensions(String jsonName)
{
this.jsonName = jsonName;
}
@JsonCreator
public static DeferExpressionDimensions fromString(final String jsonName)
{
for (final DeferExpressionDimensions value : values()) {
if (value.jsonName.equals(jsonName)) {
return value;
}
}
throw new IAE("Invalid value[%s] for[%s]", jsonName, JSON_KEY);
}
public abstract boolean useDeferredGroupBySelector(
ExpressionPlan plan,
List<String> requiredBindingsList,
ColumnInspector inspector
);
@Override
@JsonValue
public String toString()
{
return jsonName;
}
/**
* {@link VectorColumnSelectorFactory} currently can only make dictionary encoded selectors for string types, soView on GitHub (pinned to 9b90983fd2)