apache/iceberg · error · UnsupportedOperationException
does not implement getMap
Error message
does not implement getMap
What it means
Capability guard in ConstantColumnVector.getMap: this vector returns a single constant for every row and only implements scalar accessors; array and map access are unimplemented and throw with the class name in the message. It fires only if the constant column is typed as a map and Spark reads it as such.
Solutions
- Disable vectorized reads for the scan (read.split.vectorization.enabled=false)
- Avoid map-typed constant substitution — rewrite the delete/filter to not use map constants
- Upgrade Iceberg to a version with broader ConstantColumnVector support
- Restructure schema so map columns are not targeted by constant-value deletes
Example fix
// before
spark.read.format("iceberg").load("t").select("map_col") // with constant map
// after
spark.conf.set("read.split.vectorization.enabled", "false") // then re-run the same query Defensive patterns
Strategy: validation
Validate before calling
if (vector instanceof ConstantColumnVector && expectedType instanceof MapType) { useNonVectorizedRead(); } Type guard
boolean supportsMaps(ColumnVector v) { return !(v instanceof ConstantColumnVector); } Try / catch
try { map = vector.getMap(ordinal); } catch (UnsupportedOperationException e) { // re-run non-vectorized }
spark.conf.set("read.split.vectorization.enabled", "false"); Prevention
- Don't use map constants in equality deletes
- Pre-validate column types against vector support before enabling vectorization
When it happens
Trigger: A vectorized read calls getMap(ordinal) on a column whose values were replaced by a constant (e.g. via equality deletes or constant folding) where the constant is or the column is map-typed.
Common situations: Equality deletes that target or substitute map columns with vectorized reads enabled; batch scans containing map columns resolved to ConstantColumnVector.
Related errors
- does not implement getArray
- does not implement getArray
- does not implement getMap
- Couldn't set Arrow properties, which may impact read…
- Couldn't set Arrow properties, which may impact read…
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/e77ec043b4e913b3.
Report an issue: GitHub.
Appendix: source
Thrown at spark/v4.0/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)