{"record":{"id":"079a669a06fa1295","repo":"apache/druid","slug":"not-implemented-079a66","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeAggregator.java","lineNumber":54,"sourceCode":"  }\n\n  @Override\n  public void aggregate()\n  {\n    bitmap.fold(selector.getObject());\n  }\n\n  @Nullable\n  @Override\n  public Object get()\n  {\n    return bitmap;\n  }\n\n  @Override\n  public float getFloat()\n  {\n    throw new UnsupportedOperationException(\"Not implemented\");\n  }\n\n  @Override\n  public long getLong()\n  {\n    throw new UnsupportedOperationException(\"Not implemented\");\n  }\n\n  @Override\n  public void close()\n  {\n    bitmap = null;\n  }\n}\n","sourceCodeStart":36,"sourceCodeEnd":69,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/druid-exact-count-bitmap/src/main/java/org/apache/druid/query/aggregation/exact/count/bitmap64/Bitmap64ExactCountMergeAggregator.java#L36-L69","documentation":"Bitmap64ExactCountMergeAggregator.getFloat() is an intentionally unimplemented stub. The merge-side aggregator merges Roaring64Bitmaps and exposes the merged bitmap via get(); float scalar access is not part of its supported surface, so getFloat() always throws UnsupportedOperationException(\"Not implemented\").","triggerScenarios":"A selector loop or post-aggregator calls getFloat() on the merge aggregator's output column instead of the cardinality accessor / get().","commonSituations":"Custom post-aggregators over BITMAP64_EXACT_COUNT results assuming numeric float output; generic value-selector code that tries getDouble/getFloat/getLong in sequence; test code exercising the Aggregator interface exhaustively.","solutions":["Obtain the count via the aggregator's dedicated accessor or bitmap.getLongCardinality() from get().","Declare/consume the aggregation result as LONG (cardinality), not FLOAT.","Dispatch on ValueType before calling scalar getters, skipping non-numeric aggregations.","Implement getFloat() in the extension if float exposure is required."],"exampleFix":"// before\nfloat v = mergeAggregator.getFloat();\n\n// after\nlong v = mergeAggregator.getLong(); // cardinality accessor provided by the merge aggregator","handlingStrategy":"type-guard","validationCode":"if (!(mergeAggregator.get() instanceof Roaring64Bitmap)) { throw new IllegalStateException(\"unexpected aggregation output\"); }","typeGuard":"boolean isBitmapAggregator(Aggregator a) { return a != null && a.get() instanceof Roaring64Bitmap; }","tryCatchPattern":"try { v = mergeAggregator.getFloat(); } catch (UnsupportedOperationException e) { v = (float) ((Roaring64Bitmap) mergeAggregator.get()).getLongCardinality(); }","preventionTips":["Consume merge aggregation results as counts (long), not floats","Check the aggregator factory's type before invoking scalar getters","Write post-aggregators against the cardinality, not raw float access"],"tags":["druid","aggregation","unsupported-operation","bitmap"],"backgroundTag":"method-not-implemented","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"}