{"record":{"id":"dbc9ec4438718f33","repo":"apache/iceberg","slug":"unsupported-type-map-dbc9ec","errorCode":null,"errorMessage":"Unsupported type - map","messagePattern":"Unsupported type - map","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v4.2/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.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/IcebergArrowColumnVector.java#L110-L146","documentation":"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.","triggerScenarios":"A query selects a map-typed column while vectorized reads are enabled, and Spark's vectorized reader calls getMap(rowId) on the resulting IcebergArrowColumnVector.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":"boolean hasMap = schema.fields().stream().anyMatch(f -> f.dataType() instanceof MapType);\nif (hasMap) { spark.conf.set(\"read.vectorization.enabled\", \"false\"); }","typeGuard":null,"tryCatchPattern":"try { vector.getMap(rowId); } catch (UnsupportedOperationException e) {\n  // switch reader to the row-based (non-vectorized) path\n}","preventionTips":["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."],"tags":["spark","arrow","vectorized-read","map-type"],"backgroundTag":"unsupported-operation","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"}