apache/druid · error · UnsupportedOperationException
Not implemented
Error message
Not implemented
What it means
DoublesSketchMergeAggregator unions existing quantiles DoublesSketches; the result is a sketch, not a scalar, so getFloat() deliberately throws UnsupportedOperationException. Numeric access to a merge aggregator is not supported by design.
Source
Thrown at extensions-core/datasketches/src/main/java/org/apache/druid/query/aggregation/datasketches/quantiles/DoublesSketchMergeAggregator.java:58
}
@Override
public synchronized void aggregate()
{
updateUnion(selector, union);
}
@Override
public synchronized Object get()
{
return union.getResult();
}
@Override
public float getFloat()
{
throw new UnsupportedOperationException("Not implemented");
}
@Override
public long getLong()
{
throw new UnsupportedOperationException("Not implemented");
}
@Override
public synchronized void close()
{
union = null;
}
static void updateUnion(ColumnValueSelector selector, DoublesUnion union)
{
final Object object = selector.getObject();
if (object == null) {View on GitHub (pinned to 9b90983fd2)
Solutions
- Call get() which returns union.getResult() (the sketch) or the finalized value
- Set shouldFinalize=true and read via get() when a numeric quantile/rank is needed
- Use quantilesDoublesSketchToQuantile/ToRank post-aggregators for typed numeric output
Example fix
// before float v = mergeAggregator.getFloat(); // after Object result = mergeAggregator.get(); double v = ((Number) result).doubleValue(); // when shouldFinalize=true
Defensive patterns
Strategy: type-guard
Validate before calling
Object result = mergeAggregator.get();
if (!(result instanceof DoublesSketch) && !(result instanceof Number)) {
throw new IllegalStateException("Unexpected merged sketch result: " + (result == null ? "null" : result.getClass()));
} Type guard
boolean isFinalized(Aggregator agg) { return agg.get() instanceof Number; } Try / catch
try {
return mergeAggregator.getFloat();
} catch (UnsupportedOperationException e) {
Object v = mergeAggregator.get();
return v instanceof Number ? ((Number) v).floatValue() : Float.NaN;
} Prevention
- Read merged sketch results through get()
- Use shouldFinalize=true for scalar outputs, post-aggregators for quantiles/ranks
- Do not type merged sketch columns as float
When it happens
Trigger: Calling getFloat() on a DoublesSketchMergeAggregator, e.g. when a query or custom code path expects a float output from a merging quantilesDoublesSketch aggregation.
Common situations: Merging sketches in subqueries whose results are consumed by numeric selectors; generic aggregator code paths defaulting to getFloat; tests asserting numeric merging.
Related errors
- AggregatorFactoryNotMergeableException(this, other)
- Not implemented
- Not implemented
- Not implemented
- not implemented
AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07).
Data as JSON: /api/errors/7087403dd7d4c0b7.
Report an issue: GitHub.