apache/iceberg · error · java.lang.UnsupportedOperationException
Unsupported type:
Error message
Unsupported type:
What it means
The same primitive(...) factory in FlinkParquetWriters falls back to a switch on the Parquet physical type (for columns without a handled annotation). Only the supported physical types get writers; any other physical type reaches the default branch and throws UnsupportedOperationException naming the primitive.
Source
Thrown at flink/v2.3/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
- Change the write schema to a supported physical type (INT32/INT64/FLOAT/DOUBLE/FIXED_LEN_BYTE_ARRAY/BINARY as appropriate).
- For timestamps, use INT64 with TIMESTAMP logical annotation instead of INT96.
- Add a mapping case in the switch if a new physical type needs support, and upstream the change.
Example fix
// before // Column: ts INT96 // after // Column: ts INT64 (TIMESTAMP(MICROS)) via TimestampType in the Iceberg schema
Defensive patterns
Strategy: validation
Validate before calling
// java
Set<PrimitiveTypeName> ok = EnumSet.of(INT32, INT64, FLOAT, DOUBLE, BOOLEAN, BINARY, FIXED_LEN_BYTE_ARRAY);
if (!ok.contains(primitive.getPrimitiveTypeName())) {
throw new IllegalArgumentException("Unsupported physical type: " + primitive.getPrimitiveTypeName());
} Try / catch
// java
try {
ParquetValueWriter<?> w = FlinkParquetWriters.createWriter(...);
} catch (UnsupportedOperationException e) {
// reject schema or remap the column before writing
} Prevention
- Never write INT96 columns; always use INT64 with a timestamp annotation.
- Derive the Parquet write schema from the Iceberg schema, not from input files.
- Validate all physical types during schema planning, not at write time.
When it happens
Trigger: Creating a Parquet value writer for a column whose unannotated primitive type is not in the supported set (e.g. INT96, or another physical type the builder does not map).
Common situations: Writing into a schema derived from legacy files with INT96 timestamps; programmatic schema construction using unusual Parquet physical types; engine-written schemas with types Iceberg's Flink writer does not handle.
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: %s
- 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/d7cfc135e6a5c5a2.
Report an issue: GitHub.