apache/iceberg · error · java.lang.UnsupportedOperationException
Unsupported type:
Error message
Unsupported type:
What it means
In FlinkParquetReaders' ReadBuilder, the primitive(...) factory maps Parquet primitive columns to Flink value readers. If a column has a logical-type annotation it is handled by the visitor; for unannotated primitives only the known parquet primitive types are supported, and anything else hits the default branch throwing UnsupportedOperationException naming the primitive.
Source
Thrown at flink/v2.3/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetReaders.java:342
return new ParquetValueReaders.ByteArrayReader(desc);
case INT32:
if (expected.typeId() == org.apache.iceberg.types.Type.TypeID.LONG) {
return new ParquetValueReaders.IntAsLongReader(desc);
} else {
return new ParquetValueReaders.UnboxedReader<>(desc);
}
case FLOAT:
if (expected.typeId() == org.apache.iceberg.types.Type.TypeID.DOUBLE) {
return new ParquetValueReaders.FloatAsDoubleReader(desc);
} else {
return new ParquetValueReaders.UnboxedReader<>(desc);
}
case BOOLEAN:
case INT64:
case DOUBLE:
return new ParquetValueReaders.UnboxedReader<>(desc);
default:
throw new UnsupportedOperationException("Unsupported type: " + primitive);
}
}
}
private static class BinaryDecimalReader
extends ParquetValueReaders.PrimitiveReader<DecimalData> {
private final int precision;
private final int scale;
BinaryDecimalReader(ColumnDescriptor desc, int precision, int scale) {
super(desc);
this.precision = precision;
this.scale = scale;
}
@Override
public DecimalData read(DecimalData ignored) {
Binary binary = column.nextBinary();View on GitHub (pinned to 86d9c8fc54)
Solutions
- Rewrite the Parquet data with standard types (e.g. convert INT96 to timestamp-millis/micros with INT64 annotation).
- Ensure the requested Iceberg schema matches the file's supported primitives; avoid reading unsupported columns by projecting them out.
- If a valid type is genuinely missing, extend ReadBuilder.primitive to add a reader case for it and contribute upstream.
Example fix
// before: reading legacy INT96 column directly // after: rewrite file // spark.sql.parquet.int96TimestampConversion=true; rewrite table so timestamps are INT64 (TIMESTAMP_MICROS)
Defensive patterns
Strategy: fallback
Validate before calling
// java
org.apache.parquet.schema.PrimitiveType pt = column.getPrimitiveType();
boolean readable = pt.getPrimitiveTypeName() == PrimitiveTypeName.BOOLEAN
|| pt.getPrimitiveTypeName() == PrimitiveTypeName.INT64
|| pt.getPrimitiveTypeName() == PrimitiveTypeName.DOUBLE
|| pt.getPrimitiveTypeName() == PrimitiveTypeName.INT32
|| pt.getPrimitiveTypeName() == PrimitiveTypeName.FLOAT
|| pt.getPrimitiveTypeName() == PrimitiveTypeName.BINARY
|| pt.getPrimitiveTypeName() == PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY; Try / catch
// java
try {
ParquetValueReader<?> r = FlinkParquetReaders.buildReader(...);
} catch (UnsupportedOperationException e) {
// log the offending primitive, fall back to a rewrite/re-read path
} Prevention
- Inspect Parquet file schemas with parquet-tools before ingesting legacy files.
- Rewrite INT96/timestamp-legacy files to standard INT64 timestamp annotations.
- Keep the iceberg-flink runtime at the same version as the writer that produced the files.
When it happens
Trigger: Reading a Parquet file whose column has a primitive type not covered by the switch (e.g. INT96 timestamps, or an annotated type the visitor declined) while using FlinkParquetReaders to build a reader for the file schema.
Common situations: Legacy Hive/Impala-written Parquet files using INT96 timestamps; exotic or newly added Parquet physical types; files written by tools with unusual column typing.
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/4721d2bd1b99e44c.
Report an issue: GitHub.