apache/iceberg · error · java.lang.UnsupportedOperationException
Unsupported type - map
Error message
Unsupported type - map
What it means
IcebergArrowColumnVector throws UnsupportedOperationException from getMap because Iceberg's Spark vectorized Arrow read path does not support reading map columns; map data must go through the non-vectorized row reader.
Source
Thrown at spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/IcebergArrowColumnVector.java:128
return accessor.getFloat(rowId);
}
@Override
public double getDouble(int rowId) {
return accessor.getDouble(rowId);
}
@Override
public ColumnarArray getArray(int rowId) {
if (isNullAt(rowId)) {
return null;
}
return accessor.getArray(rowId);
}
@Override
public ColumnarMap getMap(int rowId) {
throw new UnsupportedOperationException("Unsupported type - map");
}
@Override
public Decimal getDecimal(int rowId, int precision, int scale) {
if (isNullAt(rowId)) {
return null;
}
return accessor.getDecimal(rowId, precision, scale);
}
@Override
public UTF8String getUTF8String(int rowId) {
if (isNullAt(rowId)) {
return null;
}
return accessor.getUTF8String(rowId);
}
View on GitHub (pinned to 86d9c8fc54)
Solutions
- Disable vectorized reads: set read.vectorization.enabled=false (table property) so map columns use the row-based reader.
- Reproject the query to avoid selecting map columns directly (e.g. explode or extract keys/values via functions that route through supported readers).
- Upgrade to an Iceberg release that adds map support to the vectorized reader for your Spark version.
- Check whether an Iceberg/Spark runtime mismatch is accidentally enabling the Arrow path for map types.
Defensive patterns
Strategy: fallback
Validate before calling
boolean hasMap = schema.fields().stream().anyMatch(f -> f.dataType() instanceof MapType);
if (hasMap) { spark.conf.set("read.vectorization.enabled", "false"); } Try / catch
try { vector.getMap(rowId); } catch (UnsupportedOperationException e) {
// switch reader to the row-based (non-vectorized) path
} Prevention
- Disable vectorized reads for tables containing map columns unless your Iceberg version supports them.
- Upgrade Iceberg to a release with vectorized map support for your Spark version.
- Test map column scans after any Iceberg upgrade.
When it happens
Trigger: A query selects a map-typed column while vectorized reads are enabled, and Spark's vectorized reader calls getMap(rowId) on the resulting IcebergArrowColumnVector.
Common situations: Reading Iceberg tables containing map columns with spark.read.format('iceberg') and vectorization on; scanning nested maps inside structs via the vectorized path; older Iceberg runtimes that lack vectorized map support.
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 - map
- Unsupported type - map
- Unsupported type - byte
- Unsupported type - byte
- Unsupported type - short
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/dbc9ec4438718f33.
Report an issue: GitHub.