{"record":{"id":"a050afa617cd49ac","repo":"apache/iceberg","slug":"unsupported-type-map-a050af","errorCode":null,"errorMessage":"Unsupported type - map","messagePattern":"Unsupported type - map","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/IcebergArrowColumnVector.java","lineNumber":128,"sourceCode":"    return accessor.getFloat(rowId);\n  }\n\n  @Override\n  public double getDouble(int rowId) {\n    return accessor.getDouble(rowId);\n  }\n\n  @Override\n  public ColumnarArray getArray(int rowId) {\n    if (isNullAt(rowId)) {\n      return null;\n    }\n    return accessor.getArray(rowId);\n  }\n\n  @Override\n  public ColumnarMap getMap(int rowId) {\n    throw new UnsupportedOperationException(\"Unsupported type - map\");\n  }\n\n  @Override\n  public Decimal getDecimal(int rowId, int precision, int scale) {\n    if (isNullAt(rowId)) {\n      return null;\n    }\n    return accessor.getDecimal(rowId, precision, scale);\n  }\n\n  @Override\n  public UTF8String getUTF8String(int rowId) {\n    if (isNullAt(rowId)) {\n      return null;\n    }\n    return accessor.getUTF8String(rowId);\n  }\n","sourceCodeStart":110,"sourceCodeEnd":146,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/IcebergArrowColumnVector.java#L110-L146","documentation":"IcebergArrowColumnVector supports primitive and array (list) accessors but not map accessors, so getMap() unconditionally throws UnsupportedOperationException. Map-typed columns cannot be read through this Arrow-backed vector.","triggerScenarios":"A vectorized batch scan selects a map-typed column, and Spark's columnar reader calls getMap(rowId) on the IcebergArrowColumnVector wrapping the map column.","commonSituations":"Querying tables containing Iceberg map columns with vectorized reads enabled (read.split.vectorization.enabled=true or Spark vectorized reader defaults for the format).","solutions":["Exclude the map column from the vectorized read (select only needed non-map columns)","Disable vectorization: set table property read.split.vectorization.enabled=false for the read","Use a non-vectorized/row-based reader (e.g. file-format-level parquet reader path)","Upgrade Iceberg — map support in vectorized reads is extended in newer versions"],"exampleFix":"// before\nspark.read.format(\"iceberg\").load(\"t\").select(\"m\") // map column + vectorized\n// after\nspark.conf.set(\"read.split.vectorization.enabled\", \"false\")\nspark.read.format(\"iceberg\").load(\"t\").select(\"m\")","handlingStrategy":"validation","validationCode":"boolean hasMap = table.schema().columns().stream().anyMatch(c -> c.type().typeId() == Types.MapType.class.cast(c.type()).typeId()); if (hasMap) { spark.conf.set(\"read.split.vectorization.enabled\", \"false\"); }","typeGuard":null,"tryCatchPattern":"try { map = vector.getMap(rowId); } catch (UnsupportedOperationException e) { // retry read without vectorization }\nspark.conf.set(\"read.split.vectorization.enabled\", \"false\"); reRunQuery();","preventionTips":["Exclude map columns from vectorized scans or disable vectorization for such tables","Keep Iceberg updated for expanded vector type support"],"tags":["spark","vectorized-read","map-type","arrow"],"backgroundTag":"operation-not-supported","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T16:17:12.679Z"}