{"record":{"id":"daed1aa8e1161198","repo":"apache/druid","slug":"not-implemented-daed1a","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/tuple/NoopArrayOfDoublesSketchBufferAggregator.java","lineNumber":58,"sourceCode":"  public void init(final ByteBuffer buf, final int position)\n  {\n  }\n\n  @Override\n  public void aggregate(final ByteBuffer buf, final int position)\n  {\n  }\n\n  @Override\n  public Object get(final ByteBuffer buf, final int position)\n  {\n    return emptySketch;\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 close()\n  {\n  }\n\n  @Override\n  public void inspectRuntimeShape(final RuntimeShapeInspector inspector)\n  {\n  }\n","sourceCodeStart":40,"sourceCodeEnd":76,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/tuple/NoopArrayOfDoublesSketchBufferAggregator.java#L40-L76","documentation":"NoopArrayOfDoublesSketchBufferAggregator is the buffer-based noop variant for the tuple sketch extension; it returns an empty sketch and deliberately implements no primitive accessors. getFloat throws UnsupportedOperationException('Not implemented') because the aggregator's output is a sketch object, not a float. It signals misuse of the aggregator in a numeric context.","triggerScenarios":"Calling getFloat(ByteBuffer, int) on this buffer aggregator — i.e. the query engine attempts to read a float metric from a sketch-typed aggregation result.","commonSituations":"Native/SQL queries applying float-typed accessors or post-aggregators to an ArrayOfDoublesSketch aggregation; copying a query pattern from a numeric aggregator to a sketch aggregator without adjusting accessors.","solutions":["Use sketch post-aggregators (ArrayOfDoublesSketchToNumEntries, sketch estimators) instead of primitive accessors on the sketch column","Verify the aggregation's output type is Sketch and route it through sketch-aware extraction","Replace the aggregator with a numeric one if a float metric is actually needed"],"exampleFix":"// before\nfloat v = bufferAggregator.getFloat(buf, pos); // throws\n// after\nObject sketch = bufferAggregator.get(buf, pos);\ndouble v = ((ArrayOfDoublesSketch) sketch).getRetainedEntries();","handlingStrategy":"type-guard","validationCode":"if (!(bufAgg instanceof ArrayOfDoublesSketchBufferAggregator)) {\n  // only then consider primitive accessors\n}","typeGuard":"boolean supportsFloat(Aggregator agg) {\n  return !(agg instanceof NoopArrayOfDoublesSketchAggregator);\n}","tryCatchPattern":"try {\n  return agg.getFloat(buf, pos);\n} catch (UnsupportedOperationException e) {\n  Object sketch = agg.get(buf, pos);\n  return ((ArrayOfDoublesSketch) sketch).estimate();\n}","preventionTips":["Treat sketch aggregators as object-producing only","Use ArrayOfDoublesSketch post-aggregators for all metric extraction","Review native query specs so numeric post-aggregators never target sketch columns"],"tags":["java","datasketches","unsupported-operation","aggregation"],"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-14T11:17:12.474Z"}