apache/druid · error · IAE
hasMultipleValues[ ] is already set, cannot change to[ ]
Error message
hasMultipleValues[%s] is already set, cannot change to[%s]
What it means
Companion guard to the valueType check: ColumnDescriptor.Builder.setHasMultipleValues rejects changing a previously set multi-value flag to a different value. It ensures a column's multi-valuedness is consistent across all parts written into the descriptor.
Solutions
- Make input segments consistent: the column must be uniformly single- or multi-valued across merged segments
- Fix the code path that sets the flag twice with different values
- Re-ingest data with normalized (single- or array-typed) values for the column
Example fix
// before builder.setHasMultipleValues(true); builder.setHasMultipleValues(false); // IAE // after builder.setHasMultipleValues(hasMultipleValues); // computed once from the column
Defensive patterns
Strategy: validation
Validate before calling
Set<Boolean> flags = inputs.stream().map(s -> s.hasMultipleValues(col)).collect(Collectors.toSet());
if (flags.size() > 1) throw new IllegalStateException("mixed multi-valuedness"); Try / catch
try { builder.setHasMultipleValues(mv); } catch (IAE e) { /* reconcile flag from inputs and rebuild */ } Prevention
- Normalize single/multi-valuedness at ingestion before merging
- Set the flag once, derived from the actual column
- Include multi-valuedness in pre-merge schema validation
When it happens
Trigger: Building a column descriptor where setHasMultipleValues(true) then setHasMultipleValues(false) (or vice versa) is called, e.g. metrics/indexer code paths disagreeing on multi-valuedness.
Common situations: Merging segments where the same column is single-valued in one and multi-valued in another; custom aggregators or extensions setting the flag twice; arrays introduced to a previously scalar column.
Understand the failure class
Background: Conflicting config options: "cannot be used together" — configuration validation errors across open-source libraries — this error's family across 162 libraries.
Related errors
- valueType[ ] is already set, cannot change to[ ]
- Actual Row count mismatch. Expected
- Attempt to add row to swapped-out sink for segment
- Column capacity exceeded
- Column capacity exceeded
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/5e9c4631067a6549.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/segment/column/ColumnDescriptor.java:157
private ValueType valueType = null;
@Nullable
private Boolean hasMultipleValues = null;
private final List<ColumnPartSerde> parts = new ArrayList<>();
public Builder setValueType(ValueType valueType)
{
if (this.valueType != null && this.valueType != valueType) {
throw new IAE("valueType[%s] is already set, cannot change to[%s]", this.valueType, valueType);
}
this.valueType = valueType;
return this;
}
public Builder setHasMultipleValues(boolean hasMultipleValues)
{
if (this.hasMultipleValues != null && this.hasMultipleValues != hasMultipleValues) {
throw new IAE(
"hasMultipleValues[%s] is already set, cannot change to[%s]", this.hasMultipleValues, hasMultipleValues
);
}
this.hasMultipleValues = hasMultipleValues;
return this;
}
public Builder addSerde(ColumnPartSerde serde)
{
parts.add(serde);
return this;
}
public ColumnDescriptor build()
{
Preconditions.checkNotNull(valueType, "must specify a valueType");
return new ColumnDescriptor(valueType, hasMultipleValues == null ? false : hasMultipleValues, parts);
}View on GitHub (pinned to 9b90983fd2)