{"record":{"id":"e616d0c7bdd46b47","repo":"apache/druid","slug":"not-implemented-e616d0","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":500,"severity":"error","filePath":"extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildBufferAggregator.java","lineNumber":73,"sourceCode":"    if (selector.isNull()) {\n      return;\n    }\n\n    final UpdateDoublesSketch sketch = helper.getSketchAtPosition(buffer, position);\n    sketch.update(selector.getDouble());\n  }\n\n  @Nullable\n  @Override\n  public Object get(ByteBuffer buf, int position)\n  {\n    return helper.get(buf, position);\n  }\n\n  @Override\n  public float getFloat(final ByteBuffer buffer, final int position)\n  {\n    throw new UnsupportedOperationException(\"Not implemented\");\n  }\n\n  @Override\n  public long getLong(final ByteBuffer buffer, final int position)\n  {\n    throw new UnsupportedOperationException(\"Not implemented\");\n  }\n\n  @Override\n  public void close()\n  {\n    helper.clear();\n  }\n\n  // A small number of sketches may run out of the given memory, request more memory on heap and move there.\n  // In that case we need to reuse the object from the cache as opposed to wrapping the new buffer.\n  @Override\n  public void relocate(int oldPosition, int newPosition, ByteBuffer oldBuffer, ByteBuffer newBuffer)","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchBuildBufferAggregator.java#L55-L91","documentation":"DoublesSketchBuildBufferAggregator.getFloat(ByteBuffer,int) is a required BufferAggregator method that this class intentionally leaves unimplemented because a sketch cannot be read as a float. The exception indicates the query is trying to extract a numeric primitive from a sketch buffer slot.","triggerScenarios":"Calling getFloat(buffer, position) on the buffer aggregator for a quantilesDoublesSketch aggregation, e.g. when a query engine or column signature treats the sketch column as a float numeric column.","commonSituations":"Mismatched ColumnValueSelector / column type signatures in custom query engines; tests or tools that read buffer aggregator values generically as floats.","solutions":["Use get(buf, position) which returns the sketch (or finalized value) object","Convert the column signature to a TYPE_COMPLEX (sketch) selector instead of a float selector","Extract numeric metrics with sketch post-aggregators instead of raw buffer reads"],"exampleFix":"// before\nfloat v = agg.getFloat(buf, position);\n// after\nObject v = agg.get(buf, position); // sketch or finalized value","handlingStrategy":"type-guard","validationCode":"Object v = bufferAggregator.get(buffer, position);\nif (v instanceof Number) { /* numeric path */ } else { /* sketch path: use sketch API */ }","typeGuard":"boolean isComplexSketchColumn(ColumnCapabilities caps) {\n  return caps.getType().equals(ValueType.COMPLEX);\n}","tryCatchPattern":"try {\n  return agg.getFloat(buffer, position);\n} catch (UnsupportedOperationException e) {\n  return Float.NaN; // sketch column: handle via get(buffer, position) and post-aggregation\n}","preventionTips":["Ensure sketch columns are declared as complex (TYPE_COMPLEX) in query signatures","Never iterate BufferAggregator slots assuming numeric primitives for sketch aggregators","Use helper.get(...) / getSketchAtPosition(...) to access sketches in buffer aggregators"],"tags":["java","druid","sketch","buffer-aggregator","unsupported-operation"],"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"}