{"record":{"id":"45dde9a3a2085d7f","repo":"apache/druid","slug":"bloom-filter-aggregators-are-query-time-only-45dde9","errorCode":null,"errorMessage":"Bloom filter aggregators are query-time only","messagePattern":"Bloom filter aggregators are query-time only","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/BloomFilterSerde.java","lineNumber":52,"sourceCode":"import java.nio.ByteBuffer;\n\n/**\n * Exists to provide an object-strategy. Bloom filters are query time only so does not fully implement this interface.\n */\npublic class BloomFilterSerde extends ComplexMetricSerde\n{\n  private static final BloomFilterObjectStrategy STRATEGY = new BloomFilterObjectStrategy();\n\n  @Override\n  public String getTypeName()\n  {\n    return BloomFilterSerializersModule.BLOOM_FILTER_TYPE_NAME;\n  }\n\n  @Override\n  public ComplexMetricExtractor getExtractor()\n  {\n    throw new UnsupportedOperationException(\"Bloom filter aggregators are query-time only\");\n  }\n\n  @Override\n  public void deserializeColumn(ByteBuffer byteBuffer, ColumnBuilder columnBuilder)\n  {\n    throw new UnsupportedOperationException(\"Bloom filter aggregators are query-time only\");\n  }\n\n  @Override\n  public GenericColumnSerializer getSerializer(\n      SegmentWriteOutMedium segmentWriteOutMedium,\n      String column,\n      IndexSpec indexSpec\n  )\n  {\n    throw new UnsupportedOperationException(\"Bloom filter aggregators are query-time only\");\n  }\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/druid-bloom-filter/src/main/java/org/apache/druid/query/aggregation/bloom/BloomFilterSerde.java#L34-L70","documentation":"BloomFilterSerde.getExtractor() throws UnsupportedOperationException because bloom filters are query-time only: there is no ingestion-time extraction from raw data into a bloom filter column. The ComplexMetricExtractor API is used at ingestion to pull values into a complex column, which this serde deliberately does not support.","triggerScenarios":"Configuring a complex metric / ingestion spec that references the bloom filter serde as a metric expecting value extraction, or any ingestion code calling getExtractor() on BloomFilterSerde.","commonSituations":"Developers trying to precompute/persist bloom filters during ingestion by declaring them as complex metrics; copy-pasting ingestion specs from other complex columns (e.g. HyperUnique) and swapping in the bloom serde.","solutions":["Remove bloom-filter metrics from ingestion specs; compute filters in queries instead","For precomputed filters, store serialized filters via your own ingestion path, not this serde's extractor API","Use the bloom filter SQL/native aggregation at query time over the source column"],"exampleFix":"// before (ingestion spec metrics)\n{\"metrics\": [{\"type\": \"bloom\", \"name\": \"bf\", \"fieldName\": \"user_id\"}]}\n// after\n// drop the metric; aggregate at query time:\n{\"aggregations\": [{\"type\": \"bloom\", \"name\": \"bf\", \"field\": {\"type\": \"default\", \"dimension\": \"user_id\"}}]}","handlingStrategy":"validation","validationCode":"// Before declaring an ingestion metric:\nboolean bloomSerde = \"bloom\".equalsIgnoreCase(metricSpec.getType());\nif (bloomSerde) throw new IllegalArgumentException(\"bloom serde has no ingestion extractor\");","typeGuard":null,"tryCatchPattern":"try {\n  extractor = serde.getExtractor();\n} catch (UnsupportedOperationException e) {\n  // route to query-time aggregation instead of ingestion metric\n}","preventionTips":["Never reference the bloom serde in ingestion 'metrics' specs","Compute bloom filters via native/SQL query aggregation only","Audit ingestion specs copied from other complex-metric types"],"tags":["druid","bloom-filter","unsupported-operation","ingestion"],"backgroundTag":"unsupported-operation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}