apache/druid · error · java.lang.UnsupportedOperationException
not supported
Error message
not supported
What it means
DoubleMeanBufferAggregator keeps the running mean in a ByteBuffer slot and supports only get() (DoubleMeanHolder.get) and getDouble(byte[],position)-style access where implemented; getFloat() is an unimplemented interface stub that throws UnsupportedOperationException.
Solutions
- Extract with get(buf, position) (a DoubleMeanHolder) and call mean(), then cast to float if desired.
- Set output type to DOUBLE for doubleMean metrics.
- Avoid float-typed post-aggregation over mean aggregators.
Example fix
// before float f = agg.getFloat(buf, pos); // after float f = (float) DoubleMeanHolder.get(buf, pos).mean();
Defensive patterns
Strategy: type-guard
Validate before calling
if (aggregator instanceof DoubleMeanBufferAggregator) { /* read via DoubleMeanHolder.get(buf, pos), not getFloat */ } Type guard
boolean isDoubleMeanBufferAgg(BufferAggregator a) { return a instanceof DoubleMeanBufferAggregator; } Try / catch
try { return agg.getFloat(buf, pos); } catch (UnsupportedOperationException e) { return (float) DoubleMeanHolder.get(buf, pos).mean(); } Prevention
- Avoid FLOAT output type with doubleMean aggregators.
- Select accessor methods based on factory type, not interface assumptions.
- Use get()/DoubleMeanHolder.get for mean extraction.
- Cover doubleMean metrics in query-layer unit tests for all output types.
When it happens
Trigger: Calling getFloat(ByteBuffer, int) on a doubleMean buffer aggregator — float-typed result extraction, group-by/vector engines reading float columns, or generic numeric iteration over aggregators.
Common situations: Queries with FLOAT output type over doubleMean metrics; frameworks assuming float support; users narrowing means to float expecting library support.
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/abbb7910e541e1d1.
Report an issue: GitHub.
Appendix: source
Thrown at processing/src/main/java/org/apache/druid/query/aggregation/mean/DoubleMeanBufferAggregator.java:78
for (Object o : (List) update) {
DoubleMeanHolder.update(buf, position, Numbers.tryParseDouble(o, 0));
}
} else {
DoubleMeanHolder.update(buf, position, Numbers.tryParseDouble(update, 0));
}
}
@Nullable
@Override
public Object get(ByteBuffer buf, int position)
{
return DoubleMeanHolder.get(buf, position);
}
@Override
public float getFloat(ByteBuffer buf, int position)
{
throw new UnsupportedOperationException("not supported");
}
@Override
public long getLong(ByteBuffer buf, int position)
{
throw new UnsupportedOperationException("not supported");
}
@Override
public double getDouble(ByteBuffer buf, int position)
{
throw new UnsupportedOperationException("not supported");
}
@Override
public void close()
{
View on GitHub (pinned to 9b90983fd2)