{"record":{"id":"a3414818c91f7b75","repo":"apache/druid","slug":"not-implemented-a34148","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/NoopDoublesSketchAggregator.java","lineNumber":45,"sourceCode":"  public Object get()\n  {\n    return DoublesSketchOperations.EMPTY_SKETCH;\n  }\n\n  @Override\n  public void aggregate()\n  {\n  }\n\n  @Override\n  public void close()\n  {\n  }\n\n  @Override\n  public float getFloat()\n  {\n    throw new UnsupportedOperationException(\"Not implemented\");\n  }\n\n  @Override\n  public long getLong()\n  {\n    throw new UnsupportedOperationException(\"Not implemented\");\n  }\n}\n","sourceCodeStart":27,"sourceCodeEnd":54,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/NoopDoublesSketchAggregator.java#L27-L54","documentation":"NoopDoublesSketchAggregator discards sketch data (used where a sketch column exists but results are not needed) and only supports get()/reset(). Numeric accessors getFloat/getLong/getDouble have no meaning for a sketch aggregate, so getFloat() throws UnsupportedOperationException('Not implemented').","triggerScenarios":"Druid engine calling getFloat() on the noop aggregator — typically when the query expects a float metric from the aggregation, or a post-aggregator/SQL projection coerces the sketch column to FLOAT.","commonSituations":"Misconfigured queries treating the sketch-typed column as a numeric metric; SQL planner coercion of the sketch column to a FLOAT/REAL type.","solutions":["Use a scalar aggregation (doubleSum/doubleMin/etc.) on a numeric column instead of the noop sketch aggregator if you need float output.","Wrap the sketch aggregation in a proper sketch post-aggregator to obtain values.","Remove any query element that requests FLOAT output from the sketch column."],"exampleFix":"// before\n{\"type\":\"quantilesDoublesSketch\", \"fieldName\":\"x\"} + FLOAT projection -> getFloat() throws\n// after\n{\"type\":\"doubleSum\", \"fieldName\":\"x\"} // if a numeric value is actually wanted","handlingStrategy":"validation","validationCode":"if (\"quantilesDoublesSketch\".equals(aggSpec.get(\"type\")) && expectsNumericColumn(query)) { throw new IllegalArgumentException(\"Sketch aggregates cannot be read as numeric columns\"); }","typeGuard":"static boolean expectsNumericMetric(Object col) { return col instanceof String && NUMERIC_METRIC_NAMES.contains(col); }","tryCatchPattern":"try { row.getFloat(\"col\"); } catch (UnsupportedOperationException e) { /* re-query with scalar aggregator or post-agg */ }","preventionTips":["Match aggregator type to expected output type (sketch vs numeric).","Avoid direct projection of sketch columns in SQL."],"tags":["druid","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"}