apache/flink · error · IllegalArgumentException
Unsupported Avro type '%s'.
Error message
Unsupported Avro type '%s'.
What it means
The terminal throw of AvroSchemaConverter's type-mapping switch: schema.getType() matched none of the handled Avro types (record, enum, array, map, union, boolean, int, long, float, double, string, bytes, null). Whatever type fell through — e.g. FIXED — is by design not convertible to Flink TypeInformation by this converter, and IllegalArgumentException names it.
Source
Thrown at flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSchemaConverter.java:226
} else if (schema.getLogicalType() == LogicalTypes.localTimestampMillis()
|| schema.getLogicalType() == LogicalTypes.localTimestampMicros()) {
return Types.LOCAL_DATE_TIME;
} else if (schema.getLogicalType() == LogicalTypes.timeMicros()
|| schema.getLogicalType() == LogicalTypes.timeMillis()) {
return Types.SQL_TIME;
}
}
return Types.LONG;
case FLOAT:
return Types.FLOAT;
case DOUBLE:
return Types.DOUBLE;
case BOOLEAN:
return Types.BOOLEAN;
case NULL:
return Types.VOID;
}
throw new IllegalArgumentException("Unsupported Avro type '" + schema.getType() + "'.");
}
/**
* Converts an Avro schema string into a nested row structure with deterministic field order and
* data types that are compatible with Flink's Table & SQL API.
*
* @param avroSchemaString Avro schema definition string
* @return data type matching the schema
*/
public static DataType convertToDataType(String avroSchemaString) {
return convertToDataType(avroSchemaString, true);
}
/**
* Converts an Avro schema string into a nested row structure with deterministic field order and
* data types that are compatible with Flink's Table & SQL API.
*
* @param avroSchemaString Avro schema definition stringView on GitHub (pinned to 2f3c205e92)
Solutions
- Replace FIXED in the schema with BYTES (equivalent for Flink's purposes): {"type":"bytes"} or use bytes with a decimal logicalType.
- Pre-normalize third-party schemas before handing them to AvroSchemaConverter.
- If decimals are the goal, declare {"type":"bytes","logicalType":"decimal",...} which the converter supports.
Example fix
// before
{"name":"price","type":{"type":"fixed","name":"D128","size":16,"logicalType":"decimal","precision":38,"scale":18}}
// after
{"name":"price","type":{"type":"bytes","logicalType":"decimal","precision":38,"scale":18}} Defensive patterns
Strategy: validation
Validate before calling
static void validateNoFixed(Schema s) {
if (s.getType() == Schema.Type.FIXED) {
throw new IllegalArgumentException("FIXED type unsupported by AvroSchemaConverter: " + s.getName());
}
if (s.getType() == Schema.Type.RECORD) {
s.getFields().forEach(f -> validateNoFixed(f.schema()));
}
if (s.getType() == Schema.Type.UNION) s.getTypes().forEach(SchemaValidator::validateNoFixed);
if (s.getType() == Schema.Type.ARRAY) validateNoFixed(s.getElementType());
if (s.getType() == Schema.Type.MAP) validateNoFixed(s.getValueType());
} Prevention
- Avoid FIXED in schemas destined for Flink type conversion; use BYTES (optionally with decimal logicalType).
- Add a schema lint step rejecting FIXED at ingest time.
When it happens
Trigger: convertToTypeInfo/convertToDataType over a schema containing a FIXED type (commonly used for decimal or MD5/UUID fields) or another type not covered by the switch.
Common situations: Schemas generated by avro-tools decimal encoding (fixed-length bytes) or other tools that prefer fixed; legacy schemas using fixed for binary blobs.
Related errors
- Schema must be set when using Generic Record
- Avro Union with NULL type is only supported. Unsupported typ
- The Avro schema is not a nullable type: %s
- Avro format doesn't support non-string as key type of map. T
- Field types must not be null.
AI-assisted analysis of apache/flink@2f3c205e92 (2026-08-14).
Data as JSON: /api/errors/a7bcb1b3873d3163.
Report an issue: GitHub.