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
- Use a VarBinary-backed accessor overriding getBinary: return vector.get(rowId).
- Add the @Override getBinary to your subclass.
- 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
- Map VarBinaryVector (and string) fields to binary-capable accessors.
- Override getBinary in subclasses.
- Test string/binary columns end-to-end through the vectorized reader.
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
- Cannot read unsupported column types:
- Unsupported type: boolean
- Unsupported type - byte
- Unsupported type - byte
- Unsupported type: decimal
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)