{"record":{"id":"dd3cd060acf87a3f","repo":"apache/druid","slug":"numeric-columns-do-not-support-bitmaps","errorCode":null,"errorMessage":"Numeric columns do not support bitmaps.","messagePattern":"Numeric columns do not support bitmaps\\.","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java","lineNumber":210,"sourceCode":"  {\n    return key;\n  }\n\n  @Override\n  public ColumnValueSelector convertUnsortedValuesToSorted(ColumnValueSelector selectorWithUnsortedValues)\n  {\n    return selectorWithUnsortedValues;\n  }\n\n  @Override\n  public void fillBitmapsFromUnsortedEncodedKeyComponent(\n      Long key,\n      int rowNum,\n      MutableBitmap[] bitmapIndexes,\n      BitmapFactory factory\n  )\n  {\n    throw new UnsupportedOperationException(\"Numeric columns do not support bitmaps.\");\n  }\n}\n","sourceCodeStart":192,"sourceCodeEnd":213,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/segment/LongDimensionIndexer.java#L192-L213","documentation":"LongDimensionIndexer.fillBitmapsFromUnsortedEncodedKeyComponent always throws UnsupportedOperationException because numeric columns are not bitmap-indexed; inverted indexes apply only to dictionary-encoded string dimensions.","triggerScenarios":"Generating inverted indexes during merge/ingestion for a numeric dimension, or any code path that iterates dictionary keys and calls fillBitmapsFromUnsortedEncodedKeyComponent on a Long (numeric) dimension.","commonSituations":"Configuring bitmap indexes on numeric columns (historically unsupported); generic index-building code that doesn't check column type.","solutions":["Skip bitmap index generation for numeric columns (they support range indexes instead)","Guard index-building code with a check that the dimension is string/dictionary-encoded","Remove index specs that request bitmap indexes on numeric dimensions"],"exampleFix":"// before\nindexer.fillBitmapsFromUnsortedEncodedKeyComponent(key, rowNum, bitmaps, factory);\n// after\nif (indexer instanceof StringDimensionIndexer) {\n  indexer.fillBitmapsFromUnsortedEncodedKeyComponent(key, rowNum, bitmaps, factory);\n}","handlingStrategy":"type-guard","validationCode":"if (capabilities.getType() != ValueType.STRING) { skip bitmap index creation; }","typeGuard":"boolean supportsBitmaps(DimensionIndexer indexer) { return indexer instanceof StringDimensionIndexer; }","tryCatchPattern":"try { indexer.fillBitmapsFromUnsortedEncodedKeyComponent(...); } catch (UnsupportedOperationException e) { /* skip; numeric columns use range indexes */ }","preventionTips":["Do not configure bitmap indexes for numeric dimensions","Branch on column type before building inverted indexes","Rely on range indexes for numeric filtering"],"tags":["druid","numeric-column","bitmap-index","unsupported-operation"],"backgroundTag":"unsupported-operation","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"}