apache/iceberg · error · UnsupportedOperationException

Unsupported type: UTF8String

Error message

Unsupported type: UTF8String

What it means

Same base-class stub pattern as the decimal case: ArrowVectorAccessor.getUTF8String throws UnsupportedOperationException by default, and only string-backed accessor subclasses override it. Calling it on a non-string vector accessor means the requested string materialization is not supported for that column.

Solutions

  1. Check the Iceberg/Arrow type of the column before calling getUTF8String; use it only for string columns
  2. Use the generic getSingleValue/getBinary path for non-string columns
  3. Confirm the concrete accessor class overrides getUTF8String (e.g. DictionaryStringAccessor, StringAccessor)
  4. If reading binary data, call getBinary instead of getUTF8String

Example fix

// before
Utf8String s = accessor.getUTF8String(rowId); // throws on non-string accessors
// after
Object v = accessor.getSingleValue(rowId);
Utf8String s = (v instanceof byte[] b) ? Utf8String.fromBytes(b) : (Utf8String) v;
Defensive patterns

Strategy: type-guard

Validate before calling

if (!columnType.typeId().equals(TypeID.STRING)) { throw new IllegalArgumentException(columnType + " is not a string"); }

Type guard

boolean isStringAccessor(ArrowVectorAccessor<?,?,?,?> a) { return a instanceof StringArrowAccessor || a instanceof DictionaryStringAccessor; }

Try / catch

try { return accessor.getUTF8String(rowId); } catch (UnsupportedOperationException e) { return Utf8String.fromBytes(accessor.getBinary(rowId)); }

Prevention

When it happens

Trigger: Calling getUTF8String(rowId) on an accessor whose ValueVector is not a VarChar/VarBinary-like string vector; toVarCharVector (per the call info) invoking getUTF8String while converting a vector that is not a string column.

Common situations: Row-materializing a vectorized batch where the schema says string but the underlying vector is a dictionary-encoded or binary vector without a string accessor; copying conversion code between accessor implementations where the override exists in one but not the other.

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/9af2c71335a00993. Report an issue: GitHub.

Appendix: source

Thrown at arrow/src/main/java/org/apache/iceberg/arrow/vectorized/ArrowVectorAccessor.java:81

  public float getFloat(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: float");
  }

  public double getDouble(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: double");
  }

  public byte[] getBinary(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: binary");
  }

  public DecimalT getDecimal(int rowId, int precision, int scale) {
    throw new UnsupportedOperationException("Unsupported type: decimal");
  }

  public Utf8StringT getUTF8String(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: UTF8String");
  }

  public ArrayT getArray(int rowId) {
    throw new UnsupportedOperationException("Unsupported type: array");
  }

  public ChildVectorT childColumn(int pos) {
    if (childColumns != null) {
      return childColumns[pos];
    } else {
      throw new IndexOutOfBoundsException("Child columns is null hence cannot find index: " + pos);
    }
  }

  public final ValueVector getVector() {
    return vector;
  }
}

View on GitHub (pinned to 86d9c8fc54)