apache/iceberg · error · UnsupportedOperationException
Unsupported logical type:
Error message
Unsupported logical type:
What it means
FlinkParquetWriters' LogicalTypeWriterBuilder implements Parquet's LogicalTypeAnnotationVisitor; when a Parquet logical type annotation has no visit method mapped to a writer, the default branch throws UnsupportedOperationException 'Unsupported logical type: <name>'. Only annotations the builder explicitly supports (decimal, timestamp, string, etc.) can be written.
Source
Thrown at flink/v2.2/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java:193
}
private ParquetValueWriter<?> newOption(Type fieldType, ParquetValueWriter<?> writer) {
int maxD = type.getMaxDefinitionLevel(path(fieldType.getName()));
return ParquetValueWriters.option(fieldType, maxD, writer);
}
@Override
public ParquetValueWriter<?> primitive(LogicalType fType, PrimitiveType primitive) {
ColumnDescriptor desc = type.getColumnDescription(currentPath());
LogicalTypeAnnotation annotation = primitive.getLogicalTypeAnnotation();
if (annotation != null) {
Optional<ParquetValueWriter<?>> writer =
annotation.accept(new LogicalTypeWriterBuilder(fType, desc));
if (writer.isPresent()) {
return writer.get();
} else {
throw new UnsupportedOperationException(
"Unsupported logical type: " + primitive.getOriginalType());
}
}
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);View on GitHub (pinned to 86d9c8fc54)
Solutions
- Change the column to a supported type (string, decimal, timestamp) before writing
- Drop or transform unsupported logical-type columns in the pipeline
- Upgrade Iceberg if support for the annotation was added in a newer release
Example fix
// before DataTypes.STRING().bridgedTo(JSON.class) // exotic annotation // after DataTypes.STRING() // plain string annotation, supported
Defensive patterns
Strategy: try-catch
Validate before calling
LogicalTypeAnnotation ann = desc.getPrimitiveType().getLogicalTypeAnnotation();
if (ann != null && !SUPPORTED_ANNOTATIONS.test(ann)) {
throw new SchemaException("Unsupported logical type: " + ann);
} Try / catch
try {
writer = logicalTypeWriterBuilder.visit(annotation).orElseThrow(...);
} catch (UnsupportedOperationException e) {
throw new WriteException("Unsupported Parquet logical type: " + e.getMessage(), e);
} Prevention
- Use only types with standard Parquet annotations (string, decimal, timestamp)
- Avoid exotic types like interval in Iceberg pipelines
- Test schema round-trips before production writes
When it happens
Trigger: Writing Flink data to Iceberg Parquet files where a column's Parquet LogicalTypeAnnotation (e.g. interval, JSON, BSON, or unknown annotations) is visited with no matching writer.
Common situations: Mapping Flink/other-engine logical types that have no Parquet-annotation representation Iceberg supports, e.g. trying to write an INTERVAL column, or files with exotic annotations from external producers.
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 logical type: ${primitive.getOriginalType()}
- Unsupported logical type:
- Unsupported logical type: " + primitive.getOriginalType()
- Unsupported type: ${primitive}
- Unsupported type: ${primitive}
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/7edd0694d04141bf.
Report an issue: GitHub.