apache/iceberg · error · java.lang.UnsupportedOperationException
${this.getClass()} does not implement getMap
Error message
${this.getClass()} does not implement getMap What it means
ConstantColumnVector (vectorized Spark reads) returns one constant value for all rows and implements only scalar accessors plus getDecimal; getMap is intentionally not implemented, so calling it throws UnsupportedOperationException. A map-valued constant column cannot be represented by this vector.
Source
Thrown at spark/v3.5/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ConstantColumnVector.java:107
@Override
public float getFloat(int rowId) {
return (float) constant;
}
@Override
public double getDouble(int rowId) {
return (double) constant;
}
@Override
public ColumnarArray getArray(int rowId) {
throw new UnsupportedOperationException(this.getClass() + " does not implement getArray");
}
@Override
public ColumnarMap getMap(int ordinal) {
throw new UnsupportedOperationException(this.getClass() + " does not implement getMap");
}
@Override
public Decimal getDecimal(int rowId, int precision, int scale) {
return (Decimal) constant;
}
@Override
public UTF8String getUTF8String(int rowId) {
return (UTF8String) constant;
}
@Override
public byte[] getBinary(int rowId) {
return (byte[]) constant;
}
@OverrideView on GitHub (pinned to 86d9c8fc54)
Solutions
- Move map-typed constant projections out of the scan (apply withColumn after reading the table)
- Disable vectorized reads: spark.sql.iceberg.vectorization.enabled=false
- Upgrade the Iceberg runtime to a version with broader constant-vector support
- Rewrite the query so the map column originates from data files, not a constant
Example fix
// before: SELECT map('k',1) AS m, * FROM iceberg_table
// after:
val df = spark.read.format("iceberg").load("db.table").withColumn("m", map(lit("k"), lit(1))) Defensive patterns
Strategy: try-catch
Validate before calling
// Ensure projected constants are scalar-only; move map-typed constants outside the scan
Try / catch
try {
df.collect();
} catch (UnsupportedOperationException e) {
if (e.getMessage().endsWith("does not implement getMap")) {
// recompute the map column post-scan or disable vectorization
} else throw e;
} Prevention
- Add map literals with withColumn after reading, not inside the same projection as the Iceberg scan
- Enable vectorization in CI to catch unsupported constant column types early
- Upgrade Iceberg when adding map-typed metadata projections
When it happens
Trigger: A vectorized Spark read where Spark calls getMap on a column materialized as ConstantColumnVector — e.g. a constant-folded map literal or a map-typed metadata column pushed into the constant vector path.
Common situations: Queries projecting map-typed literals or constant map columns alongside an Iceberg scan with vectorization enabled; optimizer folding map expressions into the scan's constant columns.
Related errors
- Unknown dummy vector holder: ${holder}
- ${this.getClass()} does not implement getArray
- Unsupported type - byte
- Unknown dummy vector holder: ${holder}
- ${class} does not implement getArray
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/84298f38e8db5644.
Report an issue: GitHub.