apache/druid · error · IllegalArgumentException
Unknown globalId [ ]
Error message
Unknown globalId [%s]
What it means
CompressedNestedDataComplexColumn.lookupId translates a global dictionary id into a value across string/long/double sub-dictionaries. If the id is beyond all three dictionary ranges it is out of the valid global id space, and the column throws IAE 'Unknown globalId'. This indicates dictionary corruption or an id from a different column.
Solutions
- Re-download/rebuild the segment (files may be corrupt)
- Ensure the query path and Druid version match the version that wrote the nested column
- Do not pass dictionary ids obtained from other columns to this column's lookup
- Check dictionary sizes in the segment metadata for inconsistencies
Example fix
// before Object v = lookupId(otherColumnGlobalId); // id from another column // after Object v = (globalId >= 0 && globalId < cardinality) ? lookupId(globalId) : null;
Defensive patterns
Strategy: validation
Validate before calling
if (globalId < 0 || globalId >= column.getCardinality()) { return null; } // id out of this column's global dictionary Type guard
boolean isValidGlobalId(CompressedNestedDataComplexColumn col, int id) { return id >= 0 && id < col.getCardinality(); } Try / catch
try { v = indexed.get(globalId); } catch (IAE e) { log.warn("Unknown globalId %s — corrupt or foreign dictionary", globalId); v = null; } Prevention
- Never share dictionary ids across columns
- Keep Druid versions consistent for nested column reads
- Re-ingest segments showing unknown-id errors — data is likely corrupt
When it happens
Trigger: next()/Indexed lookups call lookupId with a globalId >= adjustDoubleId + doubleDictionary.size(); typically reading data written by a different (mismatched) segment version or a corrupted nested column.
Common situations: Mixed Druid versions reading nested columns across incompatible releases; copied dictionary ids between columns; corrupted deep-storage segment files.
Understand the failure class
Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.
Related errors
- not a scalar in the dictionary
- A-Not-B requires at least 1 sketch
- bitmapEncoding[ ] does not match indexSpec.bitmap[ ]
- BloomKFilters are not compatible for merging. this
- Bucket index out of range (0, )
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/68c89e61e6e95b42.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/segment/nested/CompressedNestedDataComplexColumn.java:277
}
return nextArray;
}
private Object lookupId(int globalId)
{
if (globalId == 0) {
return null;
}
final int adjustLongId = stringDictionary.size();
final int adjustDoubleId = stringDictionary.size() + longDictionary.size();
if (globalId < adjustLongId) {
return StringUtils.fromUtf8Nullable(stringDictionary.get(globalId));
} else if (globalId < adjustDoubleId) {
return longDictionary.get(globalId - adjustLongId);
} else if (globalId < adjustDoubleId + doubleDictionary.size()) {
return doubleDictionary.get(globalId - adjustDoubleId);
}
throw new IAE("Unknown globalId [%s]", globalId);
}
};
};
return new Indexed<>()
{
@Override
public int size()
{
return arrayDictionarySupplier.get().size();
}
@Nullable
@Override
public Object[] get(int index)
{
throw new UnsupportedOperationException("get not supported");
}
View on GitHub (pinned to 9b90983fd2)