{"record":{"id":"61e24dc73160c6a8","repo":"apache/druid","slug":"not-implemented-61e24d","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"warning","filePath":"extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchBuildBufferAggregator.java","lineNumber":84,"sourceCode":"    double x = selector.getDouble();\n    ms0.add(x);\n\n    mutationBuffer.position(position);\n    ms0.toBytes(mutationBuffer);\n  }\n\n  @Override\n  public synchronized Object get(final ByteBuffer buffer, final int position)\n  {\n    ByteBuffer mutationBuffer = buffer.duplicate();\n    mutationBuffer.position(position);\n    return MomentSketchWrapper.fromBytes(mutationBuffer);\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  }\n}\n","sourceCodeStart":66,"sourceCodeEnd":98,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-contrib/momentsketch/src/main/java/org/apache/druid/query/aggregation/momentsketch/aggregator/MomentSketchBuildBufferAggregator.java#L66-L98","documentation":"MomentSketchBuildBufferAggregator.getFloat throws UnsupportedOperationException because the vectorized/buffered sketch aggregator does not support float access; the buffered state holds serialized sketch bytes, which cannot yield a scalar float. It indicates the query engine asked for the aggregation in an unsupported numeric form.","triggerScenarios":"Druid's query engine invokes getFloat(buffer, position) on the buffer aggregator, which happens when the momentsketch aggregation is requested with FLOAT output type in a native query or the vectorized path coerces to float.","commonSituations":"Queries written against numeric aggregations adapted to sketch metrics; SQL planner choosing FLOAT coercion for the column; group-by/timeseries engines accessing the buffer aggregator with a float column type.","solutions":["Declare the aggregation output as COMPLEX so the engine reads sketch objects instead of floats.","Remove float-typed post-aggregators or column casts applied to the sketch metric.","Use the sketch post-aggregators provided by the extension to extract numeric values.","Check the native query JSON for a configured \"type\":\"FLOAT\" on the sketch aggregator and remove it."],"exampleFix":"// before\n{\"type\": \"momentsketch\", \"fieldName\": \"value\", \"outputType\": \"FLOAT\"}\n// after\n{\"type\": \"momentsketch\", \"fieldName\": \"value\"}","handlingStrategy":"validation","validationCode":"// validate native query JSON before submission\nif (\"FLOAT\".equals(aggregatorSpec.get(\"outputType\"))) {\n  throw new IllegalArgumentException(\"momentsketch buffer aggregator does not support FLOAT output\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  Float v = bufferAggregator.getFloat(buffer, position);\n} catch (UnsupportedOperationException e) {\n  // fall back to complex read: MomentSketchWrapper.fromBytes over the buffer region\n  MomentSketchWrapper sketch = bufferAggregator.get(buffer, position);\n}","preventionTips":["Configure COMPLEX output type for all momentsketch aggregations.","Avoid float casts/post-aggregators on sketch columns.","Test vectorized paths (group-by/timeseries) with sketch metrics before rollout.","Check query JSON outputType before submission."],"tags":["unsupported-operation","aggregation","sketch","vectorized","druid"],"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"}