apache/iceberg · error · UnsupportedOperationException
Unsupported timestamp type: ${timestamps}
Error message
Unsupported timestamp type: ${timestamps} What it means
LogicalTypeWriterBuilder.visit(TimestampLogicalTypeAnnotation) supports NANOS and MICROS units; any other timestamp unit falls to the default and throws UnsupportedOperationException. Parquet timestamps are only expected in micro or nano precision.
Source
Thrown at flink/v1.20/flink/src/main/java/org/apache/iceberg/flink/data/FlinkParquetWriters.java:263
Preconditions.checkArgument(
LogicalTypeAnnotation.TimeUnit.MICROS.equals(times.getUnit()),
"Cannot write time in %s, only MICROS is supported",
times.getUnit());
return Optional.of(timeMicros(desc));
}
@Override
public Optional<ParquetValueWriter<?>> visit(TimestampLogicalTypeAnnotation timestamps) {
ParquetValueWriter<TimestampData> writer;
switch (timestamps.getUnit()) {
case NANOS:
writer = timestampNanos(desc);
break;
case MICROS:
writer = timestamps(desc);
break;
default:
throw new UnsupportedOperationException("Unsupported timestamp type: " + timestamps);
}
return Optional.of(writer);
}
@Override
public Optional<ParquetValueWriter<?>> visit(IntLogicalTypeAnnotation type) {
Preconditions.checkArgument(type.isSigned(), "Cannot write unsigned integer type: %s", type);
ParquetValueWriter<?> writer;
if (type.getBitWidth() < 64) {
writer = ints(flinkType, desc);
} else {
writer = ParquetValueWriters.longs(desc);
}
return Optional.of(writer);
}
View on GitHub (pinned to 86d9c8fc54)
Solutions
- Rewrite the data with timestamp columns in MICROS or NANOS units (standard for Iceberg).
- Upgrade the parquet-column/parquet-hadoop dependencies to versions that only produce MICROS/NANOS annotations.
- Drop the timestamp annotation or cast the column to a plain int64 if sub-second semantics are not needed.
- Inspect the file schema with parquet-tools to confirm the actual TimeUnit before patching Iceberg.
Example fix
// before: column annotated as TIMESTAMP(MILLIS) // after: rewrite with standard precision // Schema: required int64 ts (TIMESTAMP(MICROS,true))
Defensive patterns
Strategy: validation
Validate before calling
if (ann instanceof TimestampLogicalTypeAnnotation ts &&
ts.getUnit() != TimeUnit.MICROS && ts.getUnit() != TimeUnit.NANOS) {
throw new IllegalArgumentException("unsupported ts unit: " + ts.getUnit());
} Try / catch
try {
writer = ...build();
} catch (UnsupportedOperationException e) {
if (e.getMessage().startsWith("Unsupported timestamp type:")) {
// convert column to micros/nanos and retry
}
} Prevention
- Write timestamps in MICROS or NANOS units only
- Align parquet-column versions across the job classpath
- Check file schemas with parquet-tools before reading
When it happens
Trigger: A Parquet column with a timestamp logical type annotation whose TimeUnit is neither MICROS nor NANOS (e.g. MILLIS from a non-standard producer or a newer parquet library unit).
Common situations: Parquet files written by older or non-conforming libraries that used millisecond timestamp annotations; version skew between parquet-column and parquet-avro jars introducing new TimeUnit values; hand-built schemas.
Related errors
- Unsupported timestamp type: ${timestamps}
- Unsupported logical type: ${primitive.getOriginalType()}
- Unsupported type: ${primitive}
- Unsupported base type for decimal: ${primitiveTypeName}
- Unsupported ZonedTimestampType.
AI-assisted analysis of apache/iceberg@86d9c8fc54 (2026-09-12).
Data as JSON: /api/errors/1f3efd026ec2f6e4.
Report an issue: GitHub.