{"record":{"id":"b68e330faea33aac","repo":"apache/druid","slug":"unknown-id-s","errorCode":null,"errorMessage":"Unknown id [%s]","messagePattern":"Unknown id \\[(.+?)\\]","errorType":"exception","errorClass":"org.apache.druid.java.util.common.IAE","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java","lineNumber":210,"sourceCode":"        return nextArray;\n      }\n\n      @Nullable\n      private Object lookupId(int id)\n      {\n        if (id == 0) {\n          return null;\n        }\n        final int adjustLongId = stringDictionary.size();\n        final int adjustDoubleId = stringDictionary.size() + longDictionary.size();\n        if (id < adjustLongId) {\n          return StringUtils.fromUtf8Nullable(stringDictionary.get(id));\n        } else if (id < adjustDoubleId) {\n          return longDictionary.get(id - adjustLongId);\n        } else if (id < adjustDoubleId + doubleDictionary.size()) {\n          return doubleDictionary.get(id - adjustDoubleId);\n        }\n        throw new IAE(\"Unknown id [%s]\", id);\n      }\n    };\n    return new Indexed<>()\n    {\n      @Override\n      public int size()\n      {\n        return arrayDictionary.size();\n      }\n\n      @Nullable\n      @Override\n      public Object[] get(int index)\n      {\n        throw new UnsupportedOperationException(\"get not supported\");\n      }\n\n      @Override","sourceCodeStart":192,"sourceCodeEnd":228,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/nested/VariantColumn.java#L192-L228","documentation":"VariantColumn.lookupId translates a dictionary-encoded integer id back to a typed value (string, long, or double) by subtracting per-type offsets. An id that falls outside all three sub-dictionary ranges is invalid for this column, so the column throws IAE 'Unknown id'. This indicates a corrupted id or a dictionary/id mismatch in the segment.","triggerScenarios":"Calling lookupId (via the Indexed accessor's next/get) with an id >= stringDictionary.size() + longDictionary.size() + doubleDictionary.size(), typically from a corrupted forward dictionary or stale index in a V1 nested segment.","commonSituations":"Reading a segment written by a buggy or older writer; manual segment manipulation or partial segment uploads; bitmap/index bitmaps referencing ids that no longer exist after a dictionary rebuild.","solutions":["Re-ingenerate the affected segment by re-running ingestion for the affected time chunk","Validate the segment's dictionary files (smoosh files) for corruption","Check for concurrent overwrite/append operations that may have replaced the segment mid-query","Upgrade Druid; some nested-column dictionary bugs were fixed in later releases"],"exampleFix":"// before\nObject value = indexed.get(badId);\n// after\nif (badId >= 0 && badId < indexed.size()) { Object value = indexed.get(badId); }","handlingStrategy":"validation","validationCode":"if (id < 0 || id >= indexed.size()) { throw new IllegalArgumentException(\"id out of dictionary range: \" + id); }","typeGuard":"static boolean isValidId(int id, int size) { return id >= 0 && id < size; }","tryCatchPattern":"try { Object v = indexed.get(id); } catch (IllegalArgumentException e) { if (e.getMessage().startsWith(\"Unknown id\")) { /* treat as corrupted segment; mark for reingest */ } else { throw e; } }","preventionTips":["Verify segment checksums before serving","Avoid concurrent segment replacement during queries","Keep historical and ingestion service versions aligned"],"tags":["druid","nested-columns","segment-corruption"],"backgroundTag":"resource-not-found","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}