{"record":{"id":"da3e5e3fbeee85e0","repo":"apache/druid","slug":"not-implemented-da3e5e","errorCode":null,"errorMessage":"Not implemented","messagePattern":"Not implemented","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/NoopDoublesSketchBufferAggregator.java","lineNumber":70,"sourceCode":"      int numRows,\n      int[] positions,\n      @Nullable int[] rows,\n      int positionOffset\n  )\n  {\n    // Nothing to do.\n  }\n\n  @Override\n  public Object get(final ByteBuffer buf, final int position)\n  {\n    return DoublesSketchOperations.EMPTY_SKETCH;\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 relocate(int oldPosition, int newPosition, ByteBuffer oldBuffer, ByteBuffer newBuffer)\n  {\n    // Nothing to do.\n  }\n\n  @Override\n  public void close()\n  {\n    // Nothing to do.","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/NoopDoublesSketchBufferAggregator.java#L52-L88","documentation":"NoopDoublesSketchBufferAggregator is a placeholder buffer aggregator used when a quantiles sketch aggregation cannot produce a numeric result. Its getFloat method unconditionally throws UnsupportedOperationException because a DoublesSketch binary value cannot be meaningfully read as a float. Druid calls getFloat when a query's final/post-aggregator output type is declared as FLOAT, which is unsupported for this aggregator.","triggerScenarios":"A query uses a quantiles sketch aggregator but requests the aggregated value as a float — e.g. a post-aggregator or SQL return type of FLOAT applied to the sketch column, or a numeric accessor invoked on the sketch output during result merge.","commonSituations":"Declaring a FLOAT output type for a sketch aggregator in native JSON queries; SQL type inference mapping a sketch post-aggregation to FLOAT; custom code that iterates buffer aggregators generically calling getFloat on every column.","solutions":["Change the query's output/post-aggregator type to DOUBLE or use the appropriate sketch post-aggregator (e.g. quantilesDoublesSketchToQuantile) instead of reading the sketch as a float","Do not call getFloat on a sketch aggregator; call get and deserialize the DoublesSketch object","If this appears in ingestion, remove a wrongly-typed finalize/post-aggregation step on the sketch column"],"exampleFix":"// before\nAggregatorFactory agg = new QuantilesDoublesSketchAggregatorFactory(\"sk\", \"val\", 128);\nPostAggregator post = new ArithmeticPostAggregator(\"out\", \"+\", Collections.singletonList(new FieldAccessPostAggregator(\"sk\"))); // resolved as FLOAT\n// after\nPostAggregator post = new QuantilesDoublesSketchToQuantilePostAggregator(\"out\", new FieldAccessPostAggregator(\"sk\"), 0.5);","handlingStrategy":"validation","validationCode":"if (agg instanceof NoopDoublesSketchBufferAggregator) { throw new IllegalArgumentException(\"Use sketch post-aggregators, not FLOAT access, for quantiles sketch columns\"); }","typeGuard":"boolean supportsFloat(Aggregator a) { return !(a instanceof NoopDoublesSketchBufferAggregator); }","tryCatchPattern":"try { value = agg.getFloat(buf, pos); } catch (UnsupportedOperationException e) { value = null; /* use agg.get() + post-aggregator */ }","preventionTips":["Never declare FLOAT output types on sketch aggregators","Use sketch-specific post-aggregators for numeric values","Treat sketch aggregator results as objects, not primitives"],"tags":["java","datasketches","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"}