apache/flink · error · UnsupportedOperationException
Unsupported type: {}
Error message
Unsupported type: {} What it means
AvroToRowDataConverters.createRowDataConverter refuses TIMESTAMP_WITH_LOCAL_TIME_ZONE when legacyTimestampMapping is true: in legacy mode TIMESTAMP_LTZ is mapped to Avro's timestamp-millis logical type without a timezone, and reading it back into a TIMESTAMP_WITH_LOCAL_TIME_ZONE RowData is unsupported, so converter construction fails fast.
Source
Thrown at flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/AvroToRowDataConverters.java:134
case SMALLINT:
return avroObject -> ((Integer) avroObject).shortValue();
case BOOLEAN: // boolean
case INTEGER: // int
case INTERVAL_YEAR_MONTH: // long
case BIGINT: // long
case INTERVAL_DAY_TIME: // long
case FLOAT: // float
case DOUBLE: // double
return avroObject -> avroObject;
case DATE:
return AvroToRowDataConverters::convertToDate;
case TIME_WITHOUT_TIME_ZONE:
return AvroToRowDataConverters::convertToTime;
case TIMESTAMP_WITHOUT_TIME_ZONE:
return AvroToRowDataConverters::convertToTimestamp;
case TIMESTAMP_WITH_LOCAL_TIME_ZONE:
if (legacyTimestampMapping) {
throw new UnsupportedOperationException("Unsupported type: " + type);
} else {
return AvroToRowDataConverters::convertToTimestamp;
}
case CHAR:
case VARCHAR:
return avroObject -> StringData.fromString(avroObject.toString());
case BINARY:
case VARBINARY:
return AvroToRowDataConverters::convertToBytes;
case DECIMAL:
return createDecimalConverter((DecimalType) type);
case ARRAY:
return createArrayConverter((ArrayType) type, legacyTimestampMapping);
case ROW:
return createRowConverter((RowType) type);
case MAP:
case MULTISET:
return createMapConverter(type, legacyTimestampMapping);View on GitHub (pinned to 2f3c205e92)
Solutions
- Disable legacy timestamp mapping (set avro.timestamp.logical-type.mapping.legacy=false / pass legacyTimestampMapping=false) so TIMESTAMP_LTZ maps to Avro local-timestamp types.
- Or change the column to TIMESTAMP(6) WITHOUT TIME ZONE if legacy mapping must stay enabled.
- Regenerate/adjust the Avro schema so it uses the non-legacy logical types (local-timestamp-millis/micros).
Example fix
// before
AvroRowDataDeserializationSchema deserializer =
new AvroRowDataDeserializationSchema(rowType, typeInfo, /*legacy*/ true, true, true);
// after
AvroRowDataDeserializationSchema deserializer =
new AvroRowDataDeserializationSchema(rowType, typeInfo, false, true, true); Defensive patterns
Strategy: validation
Validate before calling
boolean hasLtz = rowType.getFields().stream()
.anyMatch(f -> f.getType().is(LogicalTypeRoot.TIMESTAMP_WITH_LOCAL_TIME_ZONE));
if (hasLtz && legacyTimestampMapping) {
throw new IllegalArgumentException("TIMESTAMP_LTZ unsupported with legacy Avro timestamp mapping");
} Type guard
static boolean ltzCompatible(RowType t, boolean legacy) {
return !legacy || t.getFields().stream()
.noneMatch(f -> f.getType().is(LogicalTypeRoot.TIMESTAMP_WITH_LOCAL_TIME_ZONE));
} Prevention
- Check the legacy mapping flag against the schema's timestamp kinds at job construction.
- Prefer non-legacy mapping for any new pipeline with LTZ columns.
When it happens
Trigger: Deserializing an Avro schema/RowType containing TIMESTAMP_WITH_LOCAL_TIME_ZONE while 'avro.timestamp.logical-type.mapping.legacy' (or the constructor flag legacyTimestampMapping) is enabled.
Common situations: Enabling the legacy mapping option for compatibility with old pipelines on a schema that has local-zoned timestamp columns; Flink version upgrades where the default flipped to false.
Related errors
- Schema must be set when using Generic Record
- Unexpected object type for TIMESTAMP logical type. Received:
- Unsupported type: {}
- Could not parse Avro schema string.
- Avro does not support TIMESTAMP type with precision: %s, it
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/ad158564333ca9f1.
Report an issue: GitHub.