{"record":{"id":"fae762598a6456ef","repo":"apache/iceberg","slug":"cannot-apply-unsupported-transform-s","errorCode":null,"errorMessage":"Cannot apply unsupported transform: %s","messagePattern":"Cannot apply unsupported transform: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"api/src/main/java/org/apache/iceberg/transforms/UnknownTransform.java","lineNumber":47,"sourceCode":"\n  private final String transform;\n\n  UnknownTransform(String transform) {\n    this.transform = transform;\n  }\n\n  /**\n   * Transforms a value to its corresponding partition value.\n   *\n   * @param value a source value\n   * @return ∅\n   * @throws UnsupportedOperationException Implementation is unknown\n   * @deprecated will be removed in 2.0.0; use {@link #bind(Type)} instead\n   */\n  @Deprecated\n  @Override\n  public T apply(S value) {\n    throw new UnsupportedOperationException(\n        String.format(\"Cannot apply unsupported transform: %s\", transform));\n  }\n\n  @Override\n  public SerializableFunction<S, T> bind(Type type) {\n    throw new UnsupportedOperationException(\n        String.format(\"Cannot bind unsupported transform: %s\", transform));\n  }\n\n  @Override\n  public boolean canTransform(Type type) {\n    // assume the transform function can be applied for any type\n    return true;\n  }\n\n  @Override\n  public Type getResultType(Type type) {\n    // the actual result type is not known","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/apache/iceberg/blob/86d9c8fc543e7c56c9f624eb725f76c9baff9570/api/src/main/java/org/apache/iceberg/transforms/UnknownTransform.java#L29-L65","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Upgrade Iceberg to a version that supports the transform named in the message","Check the transform with Transform.toString()/the spec before evaluating partitions, and reject unknown transforms up front","Catch UnsupportedOperationException around partition evaluation when reading foreign tables and skip/rebuild the affected partitions"],"exampleFix":"// before\nObject v = unknownTransform.apply(record.getField(\"ts\"));\n// after\nif (transform instanceof UnknownTransform) {\n  throw new IllegalArgumentException(\"Unknown transform: \" + transform);\n}\nObject v = transform.bind(sourceType).apply(record.getField(\"ts\"));","handlingStrategy":"try-catch","validationCode":"if (transform instanceof UnknownTransform) {\n  throw new IllegalArgumentException(\"Unknown transform in partition spec: \" + transform);\n}","typeGuard":"boolean isKnown(Transform<?, ?> t) {\n  return !(t instanceof UnknownTransform);\n}","tryCatchPattern":"try { return transform.bind(type).apply(value); } catch (UnsupportedOperationException e) { throw new IllegalStateException(\"Cannot evaluate partitions: transform unknown to this Iceberg version: \" + transform, e); }","preventionTips":["Inspect partition specs for UnknownTransform instances right after loading a table","Keep Iceberg upgraded to at least the version that wrote the table","Reject or skip partitions using unknown transforms instead of evaluating them"],"tags":["java","iceberg","transform","unknown-transform","forward-compatibility"],"backgroundTag":"unsupported-operation","analyzedSha":"86d9c8fc543e7c56c9f624eb725f76c9baff9570","analyzedAt":"2026-09-12T00:46:39.097Z","contentChangedAt":"2026-09-12T00:46:39.097Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}