apache/iceberg · error

Cannot apply unsupported transform: %s

Error message

Cannot apply unsupported transform: %s

What it means

UnknownTransform wraps a transform name that Iceberg cannot resolve (e.g. a transform from a newer spec version or a third-party extension). Both its deprecated apply(value) and its bind(Type) throw UnsupportedOperationException because the transform's semantics are unknown and applying it would silently produce wrong partition values. The error message includes the unknown transform's string representation.

Source

Thrown at api/src/main/java/org/apache/iceberg/transforms/UnknownTransform.java:47

  private final String transform;

  UnknownTransform(String transform) {
    this.transform = transform;
  }

  /**
   * Transforms a value to its corresponding partition value.
   *
   * @param value a source value
   * @return ∅
   * @throws UnsupportedOperationException Implementation is unknown
   * @deprecated will be removed in 2.0.0; use {@link #bind(Type)} instead
   */
  @Deprecated
  @Override
  public T apply(S value) {
    throw new UnsupportedOperationException(
        String.format("Cannot apply unsupported transform: %s", transform));
  }

  @Override
  public SerializableFunction<S, T> bind(Type type) {
    throw new UnsupportedOperationException(
        String.format("Cannot bind unsupported transform: %s", transform));
  }

  @Override
  public boolean canTransform(Type type) {
    // assume the transform function can be applied for any type
    return true;
  }

  @Override
  public Type getResultType(Type type) {
    // the actual result type is not known

View on GitHub (pinned to 86d9c8fc54)

Solutions

  1. Upgrade Iceberg to a version that supports the transform named in the message
  2. Check the transform with Transform.toString()/the spec before evaluating partitions, and reject unknown transforms up front
  3. Catch UnsupportedOperationException around partition evaluation when reading foreign tables and skip/rebuild the affected partitions

Example fix

// before
Object v = unknownTransform.apply(record.getField("ts"));
// after
if (transform instanceof UnknownTransform) {
  throw new IllegalArgumentException("Unknown transform: " + transform);
}
Object v = transform.bind(sourceType).apply(record.getField("ts"));
Defensive patterns

Strategy: try-catch

Validate before calling

if (transform instanceof UnknownTransform) {
  throw new IllegalArgumentException("Unknown transform in partition spec: " + transform);
}

Type guard

boolean isKnown(Transform<?, ?> t) {
  return !(t instanceof UnknownTransform);
}

Try / catch

try { return transform.bind(type).apply(value); } catch (UnsupportedOperationException e) { throw new IllegalStateException("Cannot evaluate partitions: transform unknown to this Iceberg version: " + transform, e); }

Prevention

When it happens

Trigger: Reading a table whose partition spec references a transform not understood by this Iceberg version, then calling apply(value) or bind(type) on the resulting UnknownTransform — e.g. evaluating partitions of a table written by a newer Iceberg or another engine.

Common situations: Opening tables produced by a newer Iceberg release with transforms this version doesn't know; corrupted or hand-edited metadata with a bogus transform name; third-party catalog extensions using custom transform names.

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