{"record":{"id":"57bf59fd564cf98c","repo":"apache/iceberg","slug":"this-getclass-does-not-implement-getarray-57bf59","errorCode":null,"errorMessage":"${this.getClass()} does not implement getArray","messagePattern":"(.+?) does not implement getArray","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"spark/v4.2/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.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ConstantColumnVector.java#L84-L120","documentation":"ConstantColumnVector represents a column where every row holds the same constant value (typically from a constant projection like partition values or residual filters). It only implements scalar accessors (getBoolean, getInt, getDouble, getDecimal...); getArray is intentionally not implemented and always throws UnsupportedOperationException, since a constant value can never be an array.","triggerScenarios":"Spark calls getArray(rowId) on a vector produced by ConstantColumnVector — i.e., a query reads an array column that the scan resolved to a constant projection (e.g. a partition column typed as a list, or a constant-folded expression producing an array).","commonSituations":"Querying a list/array-typed column that comes from constant folding or partition-value projection; using Iceberg expressions that constant-fold into array types; Spark's vectorized reader accessing array elements on a constant vector.","solutions":["Re-examine the query/schema: an array column should never be constant-projected; check whether the partition spec contains an array-typed partition field (unsupported) and remove or change it.","Disable vectorized reads for the query (read.vectorization.enabled=false) so the non-vectorized path materializes the constant value instead.","If this is a legitimate new requirement, implement getArray in ConstantColumnVector to return a ColumnarArray filled with the constant value.","Upgrade Iceberg/Spark to a version where the constant-projection path for this type is handled."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (vector instanceof ConstantColumnVector && expectedType instanceof ArrayType) {\n  throw new IllegalStateException(\"Constant projection cannot yield an array column\");\n}","typeGuard":"boolean supportsArrays(ColumnVector v) { return !(v instanceof ConstantColumnVector); }","tryCatchPattern":"try { vector.getArray(rowId); } catch (UnsupportedOperationException e) {\n  // fall back to non-vectorized read for this column\n}","preventionTips":["Never define partition fields over array-typed columns.","Keep constant projection to scalar partition values.","Test queries that reference partition columns under vectorized reads."],"tags":["spark","vectorized-read","constant-projection","unsupported-type"],"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"}