{"record":{"id":"fc571f5c9584f7fd","repo":"apache/druid","slug":"not-implemented-fc571f","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregator.java","lineNumber":84,"sourceCode":"    union.update(sketch.getSketch());\n  }\n\n  @Override\n  public Object get(final ByteBuffer buf, final int position)\n  {\n    return HllSketchHolder.of(helper.get(buf, position));\n  }\n\n  @Override\n  public void close()\n  {\n    helper.clear();\n  }\n\n  @Override\n  public float getFloat(final ByteBuffer buf, final int position)\n  {\n    throw new UnsupportedOperationException(\"Not implemented\");\n  }\n\n  @Override\n  public long getLong(final ByteBuffer buf, final int position)\n  {\n    throw new UnsupportedOperationException(\"Not implemented\");\n  }\n\n  @Override\n  public void inspectRuntimeShape(RuntimeShapeInspector inspector)\n  {\n    inspector.visit(\"selector\", selector);\n    // lgK should be inspected because different execution paths exist in Union.update() that is called from\n    // @CalledFromHotLoop-annotated aggregate() depending on the lgK.\n    // See https://github.com/apache/druid/pull/6893#discussion_r250726028\n    inspector.visit(\"lgK\", helper.getLgK());\n  }\n","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchMergeBufferAggregator.java#L66-L102","documentation":"HllSketchMergeBufferAggregator supports only getDouble() for numeric reads; getFloat() is explicitly unimplemented because HLL estimates are doubles and float truncation is undesirable. Calling it throws UnsupportedOperationException. Read the estimate with getDouble() or access the sketch directly.","triggerScenarios":"Calling bufferAggregator.getFloat(buf, position), or running a vectorized/query path whose column type is FLOAT over an HLL merge metric.","commonSituations":"Native queries typed as float over a sketch metric; custom aggregation frameworks reading via float accessors; incorrect intermediateType assumptions in post-aggregation code.","solutions":["Use getDouble(buf, position) instead of getFloat","Type the aggregation as \"double\"/sketch in the query spec rather than \"float\"","For finalized values use HllSketchHolder/estimate accessors instead of raw buffer reads"],"exampleFix":"// before\nfloat v = agg.getFloat(buf, position);\n// after\ndouble v = agg.getDouble(buf, position);","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":"try { v = agg.getFloat(buf, pos); } catch (UnsupportedOperationException e) { v = (float) agg.getDouble(buf, pos); }","preventionTips":["Use getDouble(buf, position) on buffer aggregators","Avoid FLOAT-typed columns over sketch merge metrics","Document that HLL numeric output is double-only"],"tags":["unsupported-operation","datasketches","hll","buffer-aggregator"],"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"}