apache/iceberg · error · java.lang.UnsupportedOperationException

Unsupported type - map

Error message

Unsupported type - map

What it means

Capability guard in IcebergArrowColumnVector.getMap: this vectorized column vector does not support exposing map values (the Arrow accessor path implements scalars and arrays but not maps). It fires only when Spark requests a map value from a vectorized batch — the read path for map columns must be row-based.

Solutions

  1. Disable vectorized reads for the query/table so the row-oriented path handles maps (spark.sql.iceberg.vectorized-enabled=false or read-specific option)
  2. Restructure the query to avoid projecting the map column in the columnar scan (e.g. extract keys/values via functions that are supported)
  3. Upgrade Iceberg, if a newer release adds map support in the vectorized reader

Example fix

// before
spark.sql("SELECT m FROM tbl"); // vectorized reads on, m is a map column
// after
spark.conf.set("spark.sql.iceberg.vectorized-enabled", "false");
spark.sql("SELECT m FROM tbl");
Defensive patterns

Strategy: validation

Validate before calling

// Avoid vectorized execution when the projection contains map columns
boolean hasMap = schema.fields().length > 0 && java.util.Arrays.stream(schema.fields())
    .anyMatch(f -> f.dataType() instanceof MapType);
if (hasMap) spark.conf().set("spark.sql.iceberg.vectorized-enabled", "false");

Prevention

When it happens

Trigger: Running a vectorized Iceberg scan whose projected schema contains a Spark MapType column, and Spark calls ColumnVector.getMap(rowId) on that batch.

Common situations: Queries selecting map columns with vectorized reads enabled; plans that Spark attempts to execute columnar but Iceberg's Arrow reader has no map accessor for.

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


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/343d59a7b14e8da5. Report an issue: GitHub.

Appendix: source

Thrown at spark/v3.5/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)