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

  1. Extract with get(buf, position) (a DoubleMeanHolder) and call mean(), then cast to float if desired.
  2. Set output type to DOUBLE for doubleMean metrics.
  3. 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

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


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)