apache/iceberg · error · java.lang.UnsupportedOperationException
Unsupported type: %s
Error message
Unsupported type: %s
What it means
FlinkParquetWriters.primitive() throws UnsupportedOperationException 'Unsupported type: <primitive>' when the Parquet physical primitive type has no writer branch in the final switch — the physical type cannot be mapped to a ParquetValueWriter for the expected Flink/Iceberg value.
Source
Thrown at flink/v2.1/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java:213
}
}
switch (primitive.getPrimitiveTypeName()) {
case FIXED_LEN_BYTE_ARRAY:
case BINARY:
return byteArrays(desc);
case BOOLEAN:
return ParquetValueWriters.booleans(desc);
case INT32:
return ints(fType, desc);
case INT64:
return ParquetValueWriters.longs(desc);
case FLOAT:
return ParquetValueWriters.floats(desc);
case DOUBLE:
return ParquetValueWriters.doubles(desc);
default:
throw new UnsupportedOperationException("Unsupported type: " + primitive);
}
}
}
private static class LogicalTypeWriterBuilder
implements LogicalTypeAnnotationVisitor<ParquetValueWriter<?>> {
private final LogicalType flinkType;
private final ColumnDescriptor desc;
private LogicalTypeWriterBuilder(LogicalType flinkType, ColumnDescriptor desc) {
this.flinkType = flinkType;
this.desc = desc;
}
@Override
public Optional<ParquetValueWriter<?>> visit(StringLogicalTypeAnnotation strings) {
return Optional.of(strings(desc));
}View on GitHub (pinned to 86d9c8fc54)
Solutions
- Identify the physical type from the message and retype the column to a supported type.
- Use another file format (ORC/Avro) if the type mapping exists there.
- Upgrade iceberg-flink to a version with broader physical type support.
- Adjust the write pipeline so the parquet physical type matches the Iceberg type mapping.
Example fix
// before // physical type unsupported by Flink writer switch // after // map column to BINARY/STRING standard physical type or switch format
Defensive patterns
Strategy: validation
Validate before calling
schema.columns().forEach(c -> {
Type.TypeID id = c.type().typeId();
Preconditions.checkArgument(id != Type.TypeID.UNKNOWN,
"Type %s has no supported Parquet physical mapping", c.type());
}); Type guard
boolean parquetWritable(Type.TypeID id) {
switch (id) {
case BOOLEAN: case INTEGER: case LONG: case FLOAT: case DOUBLE:
case STRING: case BINARY: case FIXED: case DATE:
case TIMESTAMP: case DECIMAL:
return true;
default:
return false;
}
} Try / catch
try {
writer.write(row);
} catch (UnsupportedOperationException e) {
if (e.getMessage().startsWith("Unsupported type")) {
LOG.error("Parquet writer cannot handle physical type: {}", e.getMessage());
}
throw e;
} Prevention
- Use standard file formats for standard types; switch format if a type is unsupported.
- Validate schema types against writer support before job launch.
- Keep iceberg-flink and parquet-columnar versions aligned.
When it happens
Trigger: Writing Parquet where a column's physical type (per the message-writer mapping, e.g. unexpected FIXED_LEN_BYTE_ARRAY usage or missing mapping) isn't one of the supported branches (BOOLEAN, INT32, INT64, FLOAT, DOUBLE, BINARY, etc.).
Common situations: Mismatch between the message/parquet type mapping and the actual primitive; unsupported physical encodings introduced by custom writers.
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
- Unsupported type:
- Unsupported logical type: ${primitive.getOriginalType()}
- Unsupported type: ${primitive}
- Unsupported base type for decimal: ${primitiveTypeName}
- Unsupported timestamp type: ${timestamps}
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/5a401855a8884967.
Report an issue: GitHub.