apache/iceberg · error · java.lang.UnsupportedOperationException
Unsupported type - byte
Error message
Unsupported type - byte
What it means
IcebergArrowColumnVector delegates column access to an Arrow accessor for the vectorized Parquet reader. Iceberg's Spark vectorized read path never maps any physical/logical Iceberg type to an Arrow byte column, so getByte is intentionally unsupported and always throws UnsupportedOperationException.
Source
Thrown at spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/IcebergArrowColumnVector.java:90
@Override
public int numNulls() {
return nullabilityHolder.numNulls();
}
@Override
public boolean isNullAt(int rowId) {
return nullabilityHolder.isNullAt(rowId) == 1;
}
@Override
public boolean getBoolean(int rowId) {
return accessor.getBoolean(rowId);
}
@Override
public byte getByte(int rowId) {
throw new UnsupportedOperationException("Unsupported type - byte");
}
@Override
public short getShort(int rowId) {
throw new UnsupportedOperationException("Unsupported type - short");
}
@Override
public int getInt(int rowId) {
return accessor.getInt(rowId);
}
@Override
public long getLong(int rowId) {
return accessor.getLong(rowId);
}
@OverrideView on GitHub (pinned to 86d9c8fc54)
Solutions
- Disable vectorized reads for tables with byte-typed columns: set read.vectorization.enabled=false on the table or session.
- Check that the Iceberg runtime version matches your Spark version (spark.sql.extensions and iceberg-spark-runtime artifact); mismatched runtimes are a common cause.
- Cast the tinyint column to integer in the query as a workaround so it uses getInt.
- Upgrade Iceberg to a version adding byte support to IcebergArrowColumnVector, or implement getByte via an appropriate Arrow accessor.
Defensive patterns
Strategy: validation
Validate before calling
if (schema.fields().stream().anyMatch(f -> f.dataType() == ByteType)) {
spark.conf.set("read.vectorization.enabled", "false");
} Try / catch
try { vector.getByte(rowId); } catch (UnsupportedOperationException e) {
byte v = (byte) vector.getInt(rowId); // fallback via int accessor
} Prevention
- Prefer int/long over tinyint for Iceberg columns read with Spark vectorization.
- Keep iceberg-spark-runtime aligned with the Spark version.
- Check vectorization coverage for your schema's types before enabling it table-wide.
When it happens
Trigger: Spark's VectorizedColumnReader or generated code invokes getByte(rowId) on an IcebergArrowColumnVector — e.g. reading a column whose Spark type is ByteType that got planned through the Arrow-based vectorized reader.
Common situations: Queries selecting tinyint columns where vectorization settings force the Arrow path; using an Iceberg/Spark version combination where byte-typed columns aren't covered by vectorized reads; schema mapping experiments that route byte data through Arrow readers.
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
- Unsupported type - byte
- Unsupported type - short
- Unsupported type - short
- Cannot read unsupported column types:
- Unsupported type: boolean
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/79a127f965dd1215.
Report an issue: GitHub.