apache/druid · error · java.lang.UnsupportedOperationException
not supported
Error message
not supported
What it means
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.
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.
Example fix
// before float f = agg.getFloat(); // after float f = (float) agg.getDouble();
Defensive patterns
Strategy: type-guard
Validate before calling
if (aggregator instanceof DoubleMeanAggregator) { /* read via get()/getDouble semantics, never getFloat */ } Type guard
boolean isDoubleMeanAgg(Aggregator a) { return a instanceof DoubleMeanAggregator; } Try / catch
try { return agg.getFloat(); } catch (UnsupportedOperationException e) { return (float) ((DoubleMeanHolder) agg.get()).mean(); } Prevention
- 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.
When it happens
Trigger: Calling getFloat() on a doubleMean aggregator — e.g. a query layer or post-aggregator requesting float-typed output from a mean aggregation.
Common situations: Queries forcing FLOAT output type for a doubleMean metric; custom engines/frames reading aggregator state as float; users expecting automatic numeric narrowing.
Understand the failure class
Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.
Related errors
- not supported
- Aggregator[ ] cannot vectorize
- ApproximateHistogramBufferAggregator does not support…
- ApproximateHistogramBufferAggregator does not support…
- ApproximateHistogramBufferAggregator does not support…
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/160e083ee183535b.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanAggregator.java:70
} else if (update instanceof List) {
for (Object o : (List) update) {
value.update(Numbers.tryParseDouble(o, 0));
}
} else {
value.update(Numbers.tryParseDouble(update, 0));
}
}
@Override
public Object get()
{
return value;
}
@Override
public float getFloat()
{
throw new UnsupportedOperationException("not supported");
}
@Override
public long getLong()
{
throw new UnsupportedOperationException("not supported");
}
@Override
public double getDouble()
{
throw new UnsupportedOperationException("not supported");
}
@Override
public void close()
{
// no resources to cleanupView on GitHub (pinned to 9b90983fd2)