apache/iceberg · error · UnsupportedOperationException

does not implement getArray

Error message

 does not implement getArray

What it means

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.

Solutions

  1. Do not select array-typed columns that resolve to constant vectors, or force non-vectorized read (read.split.vectorization.enabled=false)
  2. Change the delete/equality-delete payload to avoid array constants
  3. Upgrade Iceberg — later versions may support constant arrays
  4. File an issue if stock deletes trigger this; it indicates a missing capability in the constant vector

Example fix

// before
row.delete("arr_col", ArraySeq) // constant array substitution + vectorized read
// after
spark.conf.set("spark.sql.iceberg.handle-timestamp-without-timezone", ...) // or disable vectorization:
spark.conf.set("read.split.vectorization.enabled", "false")
Defensive patterns

Strategy: validation

Validate before calling

if (vector instanceof ConstantColumnVector && expectedType instanceof ArrayType) { useNonVectorizedRead(); }

Type guard

boolean supportsArrays(ColumnVector v) { return !(v instanceof ConstantColumnVector); }

Try / catch

try { arr = vector.getArray(rowId); } catch (UnsupportedOperationException e) { // fall back to row-based read }
spark.conf.set("read.split.vectorization.enabled", "false");

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12). Data as JSON: /api/errors/356e57b3e4abc80a. Report an issue: GitHub.

Appendix: source

Thrown at spark/v4.0/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/ConstantColumnVector.java:102

  @Override
  public long getLong(int rowId) {
    return (long) constant;
  }

  @Override
  public float getFloat(int rowId) {
    return (float) constant;
  }

  @Override
  public double getDouble(int rowId) {
    return (double) constant;
  }

  @Override
  public ColumnarArray getArray(int rowId) {
    throw new UnsupportedOperationException(this.getClass() + " does not implement getArray");
  }

  @Override
  public ColumnarMap getMap(int ordinal) {
    throw new UnsupportedOperationException(this.getClass() + " does not implement getMap");
  }

  @Override
  public Decimal getDecimal(int rowId, int precision, int scale) {
    return (Decimal) constant;
  }

  @Override
  public UTF8String getUTF8String(int rowId) {
    return (UTF8String) constant;
  }

  @Override

View on GitHub (pinned to 86d9c8fc54)