apache/iceberg · error · UnsupportedOperationException

Unsupported type: binary

Error message

Unsupported type: binary

What it means

The base ArrowVectorAccessor.getBinary(int) is an unimplemented stub that always throws. Binary (VarBinary) accessors must override it; hitting the base means the accessor for this vector cannot return binary data. toVarBinaryVector depends on a subclass override.

Solutions

  1. Use a VarBinary-backed accessor overriding getBinary: return vector.get(rowId).
  2. Add the @Override getBinary to your subclass.
  3. Verify accessor-factory dispatch maps VarBinary (and string) fields to the binary accessor.

Example fix

// before
class MyAccessor extends ArrowVectorAccessor<VarBinaryVector> { } // getBinary missing
// after
@Override public byte[] getBinary(int rowId) { return vector.get(rowId); }
Defensive patterns

Strategy: type-guard

Validate before calling

if (!(accessor instanceof BinaryAccessor)) { /* fallback */ }

Type guard

static boolean supportsBinary(ArrowVectorAccessor<?> a) {
  return a.getClass() != ArrowVectorAccessor.class;
}

Try / catch

try {
  byte[] v = accessor.getBinary(rowId);
} catch (UnsupportedOperationException e) {
  if ("Unsupported type: binary".equals(e.getMessage())) { fallbackRead(rowId); } else { throw e; }
}

Prevention

When it happens

Trigger: Reading a binary/string column through a non-binary accessor or raw base class; accessor factory mapping VarBinaryVector to a generic accessor.

Common situations: Custom readers materializing string/binary columns into engine vectors; subclasses missing the getBinary override; test code instantiating the base accessor directly.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/da81d9e5794a551e. Report an issue: GitHub.

Appendix: source

Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowVectorAccessor.java:73

  public int getInt(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: int");
  }

  public long getLong(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: long");
  }

  public float getFloat(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: float");
  }

  public double getDouble(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: double");
  }

  public byte[] getBinary(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: binary");
  }

  public DecimalT getDecimal(int rowId, int precision, int scale) {
    throw new UnsupportedOperationException("Unsupported type: decimal");
  }

  public Utf8StringT getUTF8String(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: UTF8String");
  }

  public ArrayT getArray(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: array");
  }

  public ChildVectorT childColumn(int pos) {
    if (childColumns != null) {
      return childColumns[pos];
    } else {

View on GitHub (pinned to 86d9c8fc54)