apache/druid · error · IllegalArgumentException

Unknown version[%s]

Error message

Unknown version[%s]

What it means

TableLongEncodingReader reads a version byte from the serialized column header and only understands CompressionFactory.TABLE_ENCODING_VERSION. Any other byte (including newer formats from future Druid versions) is rejected with this IAE, guarding against misinterpreting unknown binary formats.

Source

Thrown at processing/src/main/java/org/apache/druid/segment/data/TableLongEncodingReader.java:50

  public TableLongEncodingReader(ByteBuffer fromBuffer)
  {
    this.buffer = fromBuffer.asReadOnlyBuffer();
    byte version = buffer.get();
    if (version == CompressionFactory.TABLE_ENCODING_VERSION) {
      int tableSize = buffer.getInt();
      if (tableSize < 0 || tableSize > CompressionFactory.MAX_TABLE_SIZE) {
        throw new IAE("Invalid table size[%s]", tableSize);
      }
      bitsPerValue = VSizeLongSerde.getBitsForMax(tableSize);
      table = new long[tableSize];
      for (int i = 0; i < tableSize; i++) {
        table[i] = buffer.getLong();
      }
      fromBuffer.position(buffer.position());
      deserializer = VSizeLongSerde.getDeserializer(bitsPerValue, buffer, buffer.position());
    } else {
      throw new IAE("Unknown version[%s]", version);
    }
  }

  private TableLongEncodingReader(ByteBuffer buffer, long[] table, int bitsPerValue)
  {
    this.buffer = buffer;
    this.table = table;
    this.bitsPerValue = bitsPerValue;
    deserializer = VSizeLongSerde.getDeserializer(bitsPerValue, buffer, buffer.position());
  }

  @Override
  public void setBuffer(ByteBuffer buffer)
  {
    deserializer = VSizeLongSerde.getDeserializer(bitsPerValue, buffer, buffer.position());
  }

  @Override

View on GitHub (pinned to 9b90983fd2)

Solutions

  1. Upgrade all Druid nodes to a version that supports the segment format in use
  2. Re-ingest or re-write the segment with a compatible Druid version
  3. Fix buffer parsing so the version byte is read from the correct position
  4. Check for segment corruption and reload the segment from deep storage

Example fix

// before
// old Druid node reading segments written by a newer version
TableLongEncodingReader reader = new TableLongEncodingReader(byteBuffer); // Unknown version[2]
// after
// upgrade the reader's Druid version, or re-ingest the segment with the older format
mvn -pl processing ... && upgrade historical nodes before serving new segments
Defensive patterns

Strategy: try-catch

Validate before calling

byte v = buf.duplicate().get(pos); if (v != CompressionFactory.TABLE_ENCODING_VERSION) { upgradeRequired = true; }

Try / catch

try { reader = new TableLongEncodingReader(buf); } catch (IAE e) { throw new SegmentLoadingException("unsupported column version; upgrade Druid nodes", e); }

Prevention

When it happens

Trigger: Deserializing a table-encoded long column written with an unknown/unsupported version byte — e.g. data produced by a newer Druid, or a buffer read from the wrong offset so a random byte is interpreted as the version.

Common situations: Rolling upgrades where a newer cluster wrote segments an older node cannot read; misaligned buffer positions when parsing custom column data; corrupted segment files.

Related errors


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