apache/iceberg · error · IllegalArgumentException
Unsupported version:
Error message
Unsupported version:
What it means
IcebergSourceSplit.writeTaskJson serializes the split's task JSON with a switch over the format version; versions 2 and 3 are handled, any other version throws IllegalArgumentException. An unsupported serialization version was requested.
Source
Thrown at flink/v1.20/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)
Solutions
- Use the standard IcebergSourceSplitSerializer (serializeV2/deserializeV2) entry points instead of calling internal versioned methods.
- Align connector versions to avoid mismatched internal version constants.
- Report a bug if this arises from stock connector code — it indicates an internal version constant error.
Defensive patterns
Strategy: validation
Validate before calling
// Only use supported serialization entry points
int v = version; // must be 2 or 3
if (v != 2 && v != 3) throw new IllegalArgumentException("Use IcebergSourceSplitSerializer instead of version " + v); Prevention
- Use IcebergSourceSplitSerializer / serializeV2-deserializeV2 public paths
- Do not call package-private versioned serialize methods with arbitrary versions
- Keep connector internals from being mixed across versions
When it happens
Trigger: serialize() called with a version constant not in {2,3} — only possible via internal/version-mismatch code paths or manual use of package-private serialization methods.
Common situations: Custom code calling package-private serialize/deserialize methods with an arbitrary version; connector internals misconfigured by classpath mixing.
Related errors
- Unknown version:
- Unknown version:
- Unknown version: {version}
- Unknown version: {version}
- Unsupported version: {version}
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/ff082d5e90eb0845.
Report an issue: GitHub.