apache/iceberg · error · UnsupportedOperationException
Unsupported type - byte
Error message
Unsupported type - byte
What it means
IcebergArrowColumnVector exposes Arrow accessors to Spark's columnar API. The Arrow-backed vectors produced here never carry byte-typed data, so getByte() is intentionally unimplemented and always throws UnsupportedOperationException.
Source
Thrown at spark/v4.0/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
- Read the column as IntegerType and cast to byte in Spark after the scan
- Disable vectorized reads (spark.read.option or read.split.vectorization.enabled=false)
- Change the table schema to avoid byte-width columns if possible
- Upgrade Iceberg in case byte accessor support was added
Example fix
// before
val df = spark.read.format("iceberg").load("t") // tinyint column read vectorized
// after
spark.conf.set("read.split.vectorization.enabled", "false")
val df = spark.read.format("iceberg").load("t").col("c").cast("byte") Defensive patterns
Strategy: type-guard
Validate before calling
if (schema.fields().anyMatch(f -> f.dataType() == ByteType)) { spark.conf.set("read.split.vectorization.enabled", "false"); } Type guard
boolean byteSafe(ColumnVector v) { return !(v instanceof IcebergArrowColumnVector); } Try / catch
try { b = vector.getByte(rowId); } catch (UnsupportedOperationException e) { int widened = vector.getInt(rowId); b = (byte) widened; } Prevention
- Read Iceberg integers as int and cast to byte in Spark
- Scan the schema for byte-typed columns before enabling vectorization
When it happens
Trigger: Spark calls getByte(rowId) on an Arrow-backed vector, which happens when a batch column's Spark type is ByteType while the reader does not produce byte accessors.
Common situations: Reading a table with a Spark ByteType-mapped column (Iceberg Integer with byte upcast, or a Spark-side cast to byte) under vectorized read.
Related errors
- Unsupported type - short
- Unsupported type - byte
- 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/4746a7d274c37ae2.
Report an issue: GitHub.