apache/iceberg · error · UnsupportedOperationException
Unsupported RawType.
Error message
Unsupported RawType.
What it means
FlinkTypeVisitor.visit(RawType) throws UnsupportedOperationException because Iceberg cannot store Flink RAW types (opaque serialized user objects). Conversion fails rather than serializing values opaquely into the Iceberg schema.
Solutions
- Convert the RAW column to a concrete SQL type (STRING, BINARY, ROW<...>) before writing to Iceberg.
- Have the UDF return a supported type or declare an explicit result DataType.
- Serialize the object to JSON/Avro bytes into a STRING/BINARY column.
Example fix
// before column RAW<'com.acme.Payload', 'com.acme.PayloadSerde'> payload; // after column STRING payload; // JSON-serialized payload
Defensive patterns
Strategy: type-guard
Validate before calling
if (dataType.getLogicalType() instanceof RawType) {
throw new IllegalArgumentException("Convert RAW columns to SQL types (STRING/BINARY/ROW) before Iceberg write");
} Prevention
- Have UDFs return SQL-native types instead of RAW Java objects.
- Serialize custom objects to JSON/bytes before storing in Iceberg columns.
When it happens
Trigger: Schema conversion over a column typed RAW('class','serializer') — usually produced by UDFs returning user objects or TypeInformation-based RAW columns.
Common situations: UDF outputs or connector columns using custom Java objects without mapping to SQL types, then landing in Iceberg sink table definitions.
Understand the failure class
Background: "is not a compatible type" / "cannot merge" errors: when a value's type doesn't match what the library requires — this error's family across 65 libraries.
Related errors
- Unsupported RawType.
- Unsupported DayTimeIntervalType.
- Unsupported DayTimeIntervalType.
- Unsupported DistinctType.
- Unsupported DistinctType.
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/cc31acfe50e589e4.
Report an issue: GitHub.
Appendix: source
Thrown at flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/FlinkTypeVisitor.java:68
@Override
public T visit(DistinctType distinctType) {
throw new UnsupportedOperationException("Unsupported DistinctType.");
}
@Override
public T visit(StructuredType structuredType) {
throw new UnsupportedOperationException("Unsupported StructuredType.");
}
@Override
public T visit(NullType nullType) {
throw new UnsupportedOperationException("Unsupported NullType.");
}
@Override
public T visit(RawType<?> rawType) {
throw new UnsupportedOperationException("Unsupported RawType.");
}
@Override
public T visit(SymbolType<?> symbolType) {
throw new UnsupportedOperationException("Unsupported SymbolType.");
}
@Override
public T visit(LogicalType other) {
throw new UnsupportedOperationException("Unsupported type: " + other);
}
}
View on GitHub (pinned to 86d9c8fc54)