apache/iceberg · error · UnsupportedOperationException

${class} does not implement getArray

Error message

${class} does not implement getArray

What it means

ConstantColumnVector represents a column whose every row has the same constant value (e.g. from a constant partition column or fill with defaults). It only supports scalar accessors; getArray (and getMap) are intentionally unimplemented and throw UnsupportedOperationException because a constant nested value is not representable this way.

Source

Thrown at spark/v4.1/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)

Solutions

  1. Upgrade iceberg-spark to a version that supports constant nested column vectors.
  2. Avoid setting constant defaults (or constant partition values) for array/map typed columns.
  3. Disable vectorized reads for the scan (read.spark.vectorization.enabled=false) to use the row-based path.

Example fix

// before
// ALTER TABLE ... ADD COLUMN tags array<string> DEFAULT array('a')
// after — avoid nested constant defaults, or:
spark.conf.set("read.spark.vectorization.enabled", "false")
Defensive patterns

Strategy: fallback

Try / catch

try {
  df = spark.read().format("iceberg").load(table);
} catch (UnsupportedOperationException e) {
  if (e.getMessage().endsWith("does not implement getArray")) {
    spark.conf().set("read.spark.vectorization.enabled", "false");
    df = spark.read().format("iceberg").load(table);
  }
}

Prevention

When it happens

Trigger: A vectorized read produces a constant vector holder for a column whose Spark type is ArrayType (or MapType), and Spark calls getArray on it — i.e. a constant of a nested type flowing through the vectorized read path.

Common situations: Schema evolution adding a nested column with a constant default via add_column with a default value; reading partition columns typed as arrays/maps; Iceberg versions lacking constant nested support.

Related errors


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