{"record":{"id":"356e57b3e4abc80a","repo":"apache/iceberg","slug":"does-not-implement-getarray","errorCode":null,"errorMessage":" does not implement getArray","messagePattern":" does not implement getArray","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":102,"sourceCode":"\n  @Override\n  public long getLong(int rowId) {\n    return (long) constant;\n  }\n\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","sourceCodeStart":84,"sourceCodeEnd":120,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ConstantColumnVector.java#L84-L120","documentation":"ConstantColumnVector represents a column whose every row is the same constant value. Array access has no meaning for a single constant, so getArray() unconditionally throws UnsupportedOperationException naming the class.","triggerScenarios":"Spark's columnar batch reader calls getArray(rowId) on a column backed by ConstantColumnVector — i.e. a constant-folded array-typed column (e.g. from a deleted-row replacement value or a partition-esque constant) that is actually read as an array.","commonSituations":"Equality-delete or constant-substitution scenarios where the substituted value is an array/list type; querying a column whose values were all replaced by a constant array during vectorized reads.","solutions":["Do not select array-typed columns that resolve to constant vectors, or force non-vectorized read (read.split.vectorization.enabled=false)","Change the delete/equality-delete payload to avoid array constants","Upgrade Iceberg — later versions may support constant arrays","File an issue if stock deletes trigger this; it indicates a missing capability in the constant vector"],"exampleFix":"// before\nrow.delete(\"arr_col\", ArraySeq) // constant array substitution + vectorized read\n// after\nspark.conf.set(\"spark.sql.iceberg.handle-timestamp-without-timezone\", ...) // or disable vectorization:\nspark.conf.set(\"read.split.vectorization.enabled\", \"false\")","handlingStrategy":"validation","validationCode":"if (vector instanceof ConstantColumnVector && expectedType instanceof ArrayType) { useNonVectorizedRead(); }","typeGuard":"boolean supportsArrays(ColumnVector v) { return !(v instanceof ConstantColumnVector); }","tryCatchPattern":"try { arr = vector.getArray(rowId); } catch (UnsupportedOperationException e) { // fall back to row-based read }\nspark.conf.set(\"read.split.vectorization.enabled\", \"false\");","preventionTips":["Avoid array-typed constants in delete payloads","Disable vectorization when equality deletes target complex types"],"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"}