{"record":{"id":"584dbda2714d2447","repo":"apache/druid","slug":"not-implemented-584dbd","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/Bitmap64ExactCountBuildAggregator.java","lineNumber":56,"sourceCode":"  @Override\n  public void aggregate()\n  {\n    if (!selector.isNull()) {\n      bitmap.add(selector.getLong());\n    }\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":38,"sourceCodeEnd":71,"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/Bitmap64ExactCountBuildAggregator.java#L38-L71","documentation":"Bitmap64ExactCountBuildAggregator.getFloat() is an intentionally unimplemented stub in the druid-exact-count-bitmap extension. The build-side aggregator only supports producing its Roaring64Bitmap object (via get()); numeric scalar accessors are unsupported because the aggregation's result type is a serialized bitmap, not a number. Calling getFloat() therefore always throws UnsupportedOperationException(\"Not implemented\").","triggerScenarios":"A query or aggregation pipeline requests a FLOAT result from the Bitmap64ExactCount build aggregator, e.g. a post-aggregator or SQL layer calls aggregator.getFloat() instead of getObject()/get() on the aggregated column.","commonSituations":"Wrapping the BITMAP64_BUILD_SIGNED/BITMAP64_BUILD_UNSIGNED aggregator in a generic metric-reading loop that iterates getDouble/getFloat/getLong; generic result-rendering code that assumes numeric aggregators; writing a custom post-aggregator that reads the intermediate bitmap value as a float.","solutions":["Read the aggregated value with get() (the Roaring64Bitmap) or via the matching bitmap accessor instead of getFloat().","If a numeric count is needed at query time, use the MERGE aggregator type (BITMAP64_EXACT_COUNT) which returns the cardinality as a long via getLong().","Check ColumnValueSelector usage: only call getFloat() when the column capabilities report a FLOAT value type; dispatch on ValueType before accessing.","If you control the extension, implement getFloat() to throw a more descriptive message or return the bitmap cardinality cast to float."],"exampleFix":"// before\nfloat v = selector.getFloat();\n\n// after\nObject raw = selector.getObject();\nif (raw instanceof Roaring64Bitmap) {\n  long cardinality = ((Roaring64Bitmap) raw).getLongCardinality();\n  float v = (float) cardinality;\n}","handlingStrategy":"type-guard","validationCode":"if (selector != null && selector.getObject() instanceof Roaring64Bitmap) { /* safe to read bitmap */ }","typeGuard":"boolean isBitmapValue(ColumnValueSelector<?> s) { return s != null && s.getObject() instanceof Roaring64Bitmap; }","tryCatchPattern":"try { v = selector.getFloat(); } catch (UnsupportedOperationException e) { Object o = selector.getObject(); v = o instanceof Roaring64Bitmap ? (float) ((Roaring64Bitmap) o).getLongCardinality() : 0f; }","preventionTips":["Read bitmap aggregations via get()/getObject(), never via numeric scalar getters","Dispatch on ValueType/ColumnCapabilities before calling getFloat/getLong/getDouble","Use the exact-count merge aggregation when a numeric count is needed","Document that BITMAP64_BUILD_* exposes an object, not a number"],"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"}