apache/iceberg · error · IllegalArgumentException

Unsupported version:

Error message

Unsupported version: 

What it means

writeTaskJson writes the task JSON string to the split's DataOutputSerializer using the format version requested by serialize(). Only versions 1-3 are handled; any other version value reaches the default branch and throws IllegalArgumentException with 'Unsupported version: '.

Solutions

  1. Use the official serializeV1/serializeV2/serializeV3 entry points, which pin correct version constants.
  2. Align iceberg-flink versions across the cluster/jar so writer and reader agree on the split format version.
  3. If you patched the serializer, add the new version case to writeTaskJson before using the new constant.
Defensive patterns

Strategy: validation

Validate before calling

if (version < 1 || version > 3) throw new IllegalArgumentException('split serialize version must be 1-3');

Prevention

When it happens

Trigger: Internal call serialize(version) with a version other than 1, 2, or 3 - practically only reachable if serializer code introduces a new version without updating writeTaskJson, or if a caller invokes the internal path with a wrong constant.

Common situations: Mismatched iceberg-flink module versions where one component writes a newer format version than the other supports; hand-rolled or patched serializer constants.

Understand the failure class

Background: Invalid enum value errors: "Unknown type", "Invalid scope", "must be one of" — when a string is not on the library's allowed list — this error's family across 23 libraries.

Related errors


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

Appendix: source

Thrown at flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/source/split/IcebergSourceSplit.java:179

      serializedBytesCache = out.getCopyOfBuffer();
      out.clear();
    }

    return serializedBytesCache;
  }

  private static void writeTaskJson(DataOutputSerializer out, String taskJson, int version)
      throws IOException {
    switch (version) {
      case 2:
        out.writeUTF(taskJson);
        break;
      case 3:
        SerializerHelper.writeLongUTF(out, taskJson);
        break;
      default:
        throw new IllegalArgumentException("Unsupported version: " + version);
    }
  }

  static IcebergSourceSplit deserializeV2(byte[] serialized, boolean caseSensitive)
      throws IOException {
    return deserialize(serialized, caseSensitive, 2);
  }

  static IcebergSourceSplit deserializeV3(byte[] serialized, boolean caseSensitive)
      throws IOException {
    return deserialize(serialized, caseSensitive, 3);
  }

  private static IcebergSourceSplit deserialize(
      byte[] serialized, boolean caseSensitive, int version) throws IOException {
    DataInputDeserializer in = new DataInputDeserializer(serialized);
    int fileOffset = in.readInt();
    long recordOffset = in.readLong();

View on GitHub (pinned to 86d9c8fc54)