apache/iceberg · error · java.lang.UnsupportedOperationException

Unsupported type - short

Error message

Unsupported type - short

What it means

IcebergArrowColumnVector supports a fixed set of Arrow-backed accessors (boolean, int, long, float, double, decimal, etc.). getShort is deliberately not implemented — no Iceberg type is read through a short Arrow vector in the Spark vectorized path — so any call throws UnsupportedOperationException.

Source

Thrown at spark/v4.2/spark/src/main/java/org/apache/iceberg/spark/data/vectorized/IcebergArrowColumnVector.java:95

  @Override
  public boolean isNullAt(int rowId) {
    return nullabilityHolder.isNullAt(rowId) == 1;
  }

  @Override
  public boolean getBoolean(int rowId) {
    return accessor.getBoolean(rowId);
  }

  @Override
  public byte getByte(int rowId) {
    throw new UnsupportedOperationException("Unsupported type - byte");
  }

  @Override
  public short getShort(int rowId) {
    throw new UnsupportedOperationException("Unsupported type - short");
  }

  @Override
  public int getInt(int rowId) {
    return accessor.getInt(rowId);
  }

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

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

  @Override

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Set read.vectorization.enabled=false for tables containing smallint columns, or cast the column to int in the query.
  2. Verify the iceberg-spark-runtime artifact matches your Spark major version (e.g. 4.2 runtime with Spark 4.2).
  3. Upgrade Iceberg — newer releases may add short support to the Arrow column vector.
  4. If you control the build, implement getShort by delegating to an Int-accessor with a cast, or add the appropriate Arrow accessor.
Defensive patterns

Strategy: validation

Validate before calling

if (schema.fields().stream().anyMatch(f -> f.dataType() == ShortType)) {
  spark.conf.set("read.vectorization.enabled", "false");
}

Try / catch

try { vector.getShort(rowId); } catch (UnsupportedOperationException e) {
  short v = (short) vector.getInt(rowId);
}

Prevention

When it happens

Trigger: Spark vectorized reading invokes getShort(rowId) on an IcebergArrowColumnVector — typically when a smallint column is planned through the Arrow vectorized reader, or engine-generated code accesses the vector with a short accessor.

Common situations: Selecting smallint columns with vectorized reads enabled; Iceberg/Spark runtime version mismatches; custom readers or UDFs that call the short accessor directly on the column vector.

Understand the failure class

Background: UnsupportedOperationException and "is not supported" errors: when a library deliberately refuses a call — this error's family across 30 libraries.

Related errors


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