{"record":{"id":"d7bddd18ac0291e5","repo":"apache/druid","slug":"not-implemented-d7bddd","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/HllSketchBuildBufferAggregator.java","lineNumber":80,"sourceCode":"    updater.update(() -> helper.getSketchAtPosition(buf, position));\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  /**\n   * In very rare cases sketches can exceed given memory, request on-heap memory and move there.\n   * We need to identify such sketches and reuse the same objects as opposed to wrapping new memory regions.\n   */\n  @Override\n  public void relocate(final int oldPosition, final int newPosition, final ByteBuffer oldBuf, final ByteBuffer newBuf)\n  {\n    helper.relocate(oldPosition, newPosition, oldBuf, newBuf);\n  }\n","sourceCodeStart":62,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/hll/HllSketchBuildBufferAggregator.java#L62-L98","documentation":"HllSketchBuildBufferAggregator.getFloat (buffered/vectorized variant) unconditionally throws UnsupportedOperationException because the sketch aggregator's result is a complex sketch, never a float. It is hit when the engine finalizes this buffer aggregator's slot as a FLOAT value.","triggerScenarios":"Vectorized/native queries that coerce the HLLSketchBuild buffer aggregator result to FLOAT, e.g. numeric post-aggregators referencing the sketch aggregator or wrong output-type inference by the query engine.","commonSituations":"Same as the on-heap variant: numeric post-aggregators applied to sketch aggregators in native JSON queries; SQL queries forcing FLOAT output on a sketch expression.","solutions":["Finalize the sketch with HLLSketchToCount post-aggregator instead of numeric coercion.","Use SQL APPROX_COUNT_DISTINCT_DS_HLL to obtain counts.","Replace the aggregator with a numeric one if numeric aggregation was intended."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (agg.getType().startsWith(\"HLLSketch\")) { requireSketchFinalizer(postAggregator); }","typeGuard":"boolean numeric = agg.getType() instanceof String t && !t.contains(\"Sketch\");","tryCatchPattern":"try { bufAggregator.getFloat(buf, pos); } catch (UnsupportedOperationException e) { /* finalize via HLLSketchToCount */ }","preventionTips":["Use sketch finalizer post-aggregators in vectorized queries","Avoid FLOAT output type on sketch aggregators"],"tags":["datasketches","hll","unsupported-operation","vectorized"],"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"}