apache/druid · error · UnsupportedOperationException

Unable to decode from Proto

Error message

Unable to decode from Proto

What it means

fromByteBuffer parses serialized DDSketch protobuf bytes read from a segment; malformed or truncated protobuf (InvalidProtocolBufferException) is converted to this IAE, indicating corrupted or incompatible serialized sketch data.

Solutions

  1. Verify the blob was written by a compatible ddsketch serde version.
  2. Re-ingest the corrupted data; do not hand-edit serialized sketches.
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchObjectStrategy.java:55 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of apache/druid@9b90983fd2 (2026-09-07). Data as JSON: /api/errors/476554130ab8deae. Report an issue: GitHub.

Appendix: source

Thrown at extensions-contrib/ddsketch/src/main/java/org/apache/druid/query/aggregation/ddsketch/DDSketchObjectStrategy.java:55

  {
    return DDSketch.class;
  }

  @Override
  public DDSketch fromByteBuffer(ByteBuffer buffer, int numBytes)
  {
    if (numBytes == 0) {
      return null;
    }
    ByteBuffer readOnlyBuffer = buffer.asReadOnlyBuffer();
    readOnlyBuffer.limit(buffer.position() + numBytes);
    try {
      com.datadoghq.sketch.ddsketch.proto.DDSketch proto = com.datadoghq.sketch.ddsketch.proto.DDSketch.parseFrom(readOnlyBuffer);
      DDSketch recovered = DDSketchProtoBinding.fromProto(() -> new CollapsingLowestDenseStore(1000), proto);
      return recovered;
    } 
    catch (InvalidProtocolBufferException e) {
      throw new UnsupportedOperationException("Unable to decode from Proto");
    }
  }

  @Override
  public byte[] toBytes(@Nullable DDSketch val)
  {
    if (val == null) {
      return EMPTY_BYTES;
    }
    return DDSketchProtoBinding.toProto(val).toByteArray();
  }

  @Override
  public int compare(DDSketch o1, DDSketch o2)
  {
    return DDSketchAggregatorFactory.COMPARATOR.compare(o1, o2);
  }

View on GitHub (pinned to 9b90983fd2)