{"record":{"id":"160e083ee183535b","repo":"apache/druid","slug":"not-supported-160e08","errorCode":null,"errorMessage":"not supported","messagePattern":"not supported","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregator.java","lineNumber":70,"sourceCode":"    } else if (update instanceof List) {\n      for (Object o : (List) update) {\n        value.update(Numbers.tryParseDouble(o, 0));\n      }\n    } else {\n      value.update(Numbers.tryParseDouble(update, 0));\n    }\n  }\n\n  @Override\n  public Object get()\n  {\n    return value;\n  }\n\n  @Override\n  public float getFloat()\n  {\n    throw new UnsupportedOperationException(\"not supported\");\n  }\n\n  @Override\n  public long getLong()\n  {\n    throw new UnsupportedOperationException(\"not supported\");\n  }\n\n  @Override\n  public double getDouble()\n  {\n    throw new UnsupportedOperationException(\"not supported\");\n  }\n\n  @Override\n  public void close()\n  {\n    // no resources to cleanup","sourceCodeStart":52,"sourceCodeEnd":88,"githubUrl":"https://github.com/apache/druid/blob/9b90983fd291f26935af934383ce360473179e4d/processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregator.java#L52-L88","documentation":"DoubleMeanAggregator represents a running mean as a DoubleMeanHolder; the only meaningful extraction is the double value. getFloat() is an interface-required stub and throws UnsupportedOperationException because a float cannot represent the holder's state losslessly and float extraction is not implemented.","triggerScenarios":"Calling getFloat() on a doubleMean aggregator — e.g. a query layer or post-aggregator requesting float-typed output from a mean aggregation.","commonSituations":"Queries forcing FLOAT output type for a doubleMean metric; custom engines/frames reading aggregator state as float; users expecting automatic numeric narrowing.","solutions":["Read the value with get()/getDouble() and cast to float yourself if needed.","Change the query/output type to DOUBLE instead of FLOAT for doubleMean metrics.","If using a post-aggregator, ensure it accesses the metric as a double-typed field."],"exampleFix":"// before\nfloat f = agg.getFloat();\n// after\nfloat f = (float) agg.getDouble();","handlingStrategy":"type-guard","validationCode":"if (aggregator instanceof DoubleMeanAggregator) { /* read via get()/getDouble semantics, never getFloat */ }","typeGuard":"boolean isDoubleMeanAgg(Aggregator a) { return a instanceof DoubleMeanAggregator; }","tryCatchPattern":"try { return agg.getFloat(); } catch (UnsupportedOperationException e) { return (float) ((DoubleMeanHolder) agg.get()).mean(); }","preventionTips":["Do not configure FLOAT output type for doubleMean metrics.","Only use primitive accessors guaranteed by the aggregator factory type.","Check AggregatorFactory.getType() before selecting accessor code.","Convert explicitly after getDouble()/get() instead of relying on float accessors."],"tags":["druid","aggregation","mean","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"9b90983fd291f26935af934383ce360473179e4d","analyzedAt":"2026-09-07T13:32:30.957Z","contentChangedAt":"2026-09-07T13:32:30.957Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}