{"record":{"id":"e77ec043b4e913b3","repo":"apache/iceberg","slug":"does-not-implement-getmap","errorCode":null,"errorMessage":" does not implement getMap","messagePattern":" does not implement getMap","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ConstantColumnVector.java","lineNumber":107,"sourceCode":"\n  @Override\n  public float getFloat(int rowId) {\n    return (float) constant;\n  }\n\n  @Override\n  public double getDouble(int rowId) {\n    return (double) constant;\n  }\n\n  @Override\n  public ColumnarArray getArray(int rowId) {\n    throw new UnsupportedOperationException(this.getClass() + \" does not implement getArray\");\n  }\n\n  @Override\n  public ColumnarMap getMap(int ordinal) {\n    throw new UnsupportedOperationException(this.getClass() + \" does not implement getMap\");\n  }\n\n  @Override\n  public Decimal getDecimal(int rowId, int precision, int scale) {\n    return (Decimal) constant;\n  }\n\n  @Override\n  public UTF8String getUTF8String(int rowId) {\n    return (UTF8String) constant;\n  }\n\n  @Override\n  public byte[] getBinary(int rowId) {\n    return (byte[]) constant;\n  }\n\n  @Override","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ConstantColumnVector.java#L89-L125","documentation":"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.","triggerScenarios":"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.","commonSituations":"Equality deletes that target or substitute map columns with vectorized reads enabled; batch scans containing map columns resolved to ConstantColumnVector.","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"],"exampleFix":"// before\nspark.read.format(\"iceberg\").load(\"t\").select(\"map_col\") // with constant map\n// after\nspark.conf.set(\"read.split.vectorization.enabled\", \"false\") // then re-run the same query","handlingStrategy":"validation","validationCode":"if (vector instanceof ConstantColumnVector && expectedType instanceof MapType) { useNonVectorizedRead(); }","typeGuard":"boolean supportsMaps(ColumnVector v) { return !(v instanceof ConstantColumnVector); }","tryCatchPattern":"try { map = vector.getMap(ordinal); } catch (UnsupportedOperationException e) { // re-run non-vectorized }\nspark.conf.set(\"read.split.vectorization.enabled\", \"false\");","preventionTips":["Don't use map constants in equality deletes","Pre-validate column types against vector support before enabling vectorization"],"tags":["spark","vectorized-read","constant-column"],"backgroundTag":"method-not-implemented","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"}