{"record":{"id":"343d59a7b14e8da5","repo":"apache/iceberg","slug":"unsupported-type-map","errorCode":null,"errorMessage":"Unsupported type - map","messagePattern":"Unsupported type - map","errorType":"exception","errorClass":"java.lang.UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v3.5/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/v3.5/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/IcebergArrowColumnVector.java#L110-L146","documentation":"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.","triggerScenarios":"Running a vectorized Iceberg scan whose projected schema contains a Spark MapType column, and Spark calls ColumnVector.getMap(rowId) on that batch.","commonSituations":"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.","solutions":["Disable vectorized reads for the query/table so the row-oriented path handles maps (spark.sql.iceberg.vectorized-enabled=false or read-specific option)","Restructure the query to avoid projecting the map column in the columnar scan (e.g. extract keys/values via functions that are supported)","Upgrade Iceberg, if a newer release adds map support in the vectorized reader"],"exampleFix":"// before\nspark.sql(\"SELECT m FROM tbl\"); // vectorized reads on, m is a map column\n// after\nspark.conf.set(\"spark.sql.iceberg.vectorized-enabled\", \"false\");\nspark.sql(\"SELECT m FROM tbl\");","handlingStrategy":"validation","validationCode":"// Avoid vectorized execution when the projection contains map columns\nboolean hasMap = schema.fields().length > 0 && java.util.Arrays.stream(schema.fields())\n    .anyMatch(f -> f.dataType() instanceof MapType);\nif (hasMap) spark.conf().set(\"spark.sql.iceberg.vectorized-enabled\", \"false\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check projected schema for maps before enabling vectorized reads","Keep map columns out of columnar scans; extract fields instead","Pin vectorized-read settings in cluster config for tables with map columns"],"tags":["spark","vectorized-reader","map-type","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}