apache/iceberg · error · IllegalArgumentException
Unsupported type: ${primitive}
Error message
Unsupported type: ${primitive} What it means
FlinkAvroWriter maps Iceberg primitive types to Avro ValueWriters. When the primitive's type falls into no supported case, the method throws IllegalArgumentException 'Unsupported type'. The write path only handles a fixed set of Iceberg primitives.
Source
Thrown at flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkAvroWriter.java:169
case SMALLINT:
return ValueWriters.shorts();
default:
return ValueWriters.ints();
}
case LONG:
return ValueWriters.longs();
case FLOAT:
return ValueWriters.floats();
case DOUBLE:
return ValueWriters.doubles();
case STRING:
return FlinkValueWriters.strings();
case FIXED:
return ValueWriters.fixed(primitive.getFixedSize());
case BYTES:
return ValueWriters.bytes();
default:
throw new IllegalArgumentException("Unsupported type: " + primitive);
}
}
}
}
View on GitHub (pinned to 86d9c8fc54)
Solutions
- Align the iceberg-flink version with the iceberg-core version that produced the schema
- Check the table schema and replace unsupported types with supported equivalents
- Extend the switch in FlinkAvroWriter if the type must be written
Example fix
// before Types.TimestampNanoPrecision in schema -> FlinkAvroWriter throws // after Use timestamp(6) in schema, or upgrade iceberg-flink to a version supporting nanos
Defensive patterns
Strategy: validation
Validate before calling
schema.columns().forEach(f -> checkTypeSupported(f.type()));
Try / catch
try { write(table); } catch (IllegalArgumentException e) { LOG.error("Unsupported Iceberg type for Avro write: {}", e.getMessage()); throw e; } Prevention
- Align iceberg-flink with iceberg-core versions
- Validate schema types at job startup
- Prefer Parquet/ORC formats when using newer types
When it happens
Trigger: Writing Avro files for a table schema containing a primitive the Avro writer does not implement (e.g. newer/unknown Iceberg primitives).
Common situations: Schema written by a newer Iceberg version than the Flink integration in use; tables containing exotic types pushed through the Avro path; module version skew between iceberg-core and iceberg-flink.
Related errors
- Unsupported YearMonthIntervalType.
- Unsupported DayTimeIntervalType.
- Unsupported DistinctType.
- Unsupported StructuredType.
- Unsupported type: %s
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/1f0558f3c1423210.
Report an issue: GitHub.