apache/druid · error · IllegalStateException
Duplicate spatial dimension names found! Check your schema…
Error message
Duplicate spatial dimension names found! Check your schema yo!
What it means
SpatialDimensionRowTransformer's constructor detects duplicate names in the configured spatialDimensions list and refuses to build, since each spatial dimension name must map to a unique schema entry. The playful message is legacy Druid wording for a duplicate-name validation error.
Solutions
- Deduplicate spatialDimensions in the ingestion spec so each dimName appears once
- If programmatically building the list, use a Map keyed by dimName before constructing transformers
- Fail spec validation early (check for duplicate spatial dim names before task submission)
Example fix
// before
spatialDimensions: [
{"dimName":"geo", "dims":["lat","lon"]},
{"dimName":"geo", "dims":["lat","lon"]}
]
// after
spatialDimensions: [ {"dimName":"geo", "dims":["lat","lon"]} ] Defensive patterns
Strategy: validation
Validate before calling
Set<String> names = new HashSet<>(); for (SpatialDimensionSchema s : spatialDimensions) assert names.add(s.getDimName());
Try / catch
try { new SpatialDimensionRowTransformer(dims); } catch (ISE e) { if (e.getMessage().contains("Duplicate spatial")) { /* dedupe spec */ } throw e; } Prevention
- Deduplicate spec lists programmatically
- Validate ingestion specs in CI
When it happens
Trigger: Building a SpatialDimensionRowTransformer with two SpatialDimensionSchema entries sharing the same dimName, e.g. a spec listing the same spatial dimension twice.
Common situations: Copy-paste errors in ingestion specs; programmatic generation of spatial dimensions that appends duplicates; merging two schemas without deduplication.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
Related errors
- A valid tlsPort needs to specified when druid.enableTlsPort…
- At least one of the druid.enablePlaintextPort or…
- At least one task runner must be enabled
- At most one of 'druid.broker.segment.watchedTiers' and…
- Backfill tasks require 'useConcurrentLocks' to be set to…
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/5cb95ac0d1bcb17c.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/segment/incremental/SpatialDimensionRowTransformer.java:61
import java.util.Set;
/**
* We throw away all invalid spatial dimensions
*/
public class SpatialDimensionRowTransformer implements Function<InputRow, InputRow>
{
private static final Joiner JOINER = Joiner.on(",");
private static final Splitter SPLITTER = Splitter.on(",");
private final Map<String, SpatialDimensionSchema> spatialDimensionMap;
private final Set<String> spatialPartialDimNames;
public SpatialDimensionRowTransformer(List<SpatialDimensionSchema> spatialDimensions)
{
this.spatialDimensionMap = new HashMap<>();
for (SpatialDimensionSchema spatialDimension : spatialDimensions) {
if (this.spatialDimensionMap.put(spatialDimension.getDimName(), spatialDimension) != null) {
throw new ISE("Duplicate spatial dimension names found! Check your schema yo!");
}
}
this.spatialPartialDimNames = Sets.newHashSet(
Iterables.concat(
Lists.transform(
spatialDimensions,
new Function<SpatialDimensionSchema, List<String>>()
{
@Override
public List<String> apply(SpatialDimensionSchema input)
{
return input.getDims();
}
}
)
)
);
}View on GitHub (pinned to 9b90983fd2)