{"record":{"id":"a7bcb1b3873d3163","repo":"apache/flink","slug":"unsupported-avro-type-s","errorCode":null,"errorMessage":"Unsupported Avro type '%s'.","messagePattern":"Unsupported Avro type '(.+?)'\\.","errorType":"exception","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSchemaConverter.java","lineNumber":226,"sourceCode":"                    } else if (schema.getLogicalType() == LogicalTypes.localTimestampMillis()\n                            || schema.getLogicalType() == LogicalTypes.localTimestampMicros()) {\n                        return Types.LOCAL_DATE_TIME;\n                    } else if (schema.getLogicalType() == LogicalTypes.timeMicros()\n                            || schema.getLogicalType() == LogicalTypes.timeMillis()) {\n                        return Types.SQL_TIME;\n                    }\n                }\n                return Types.LONG;\n            case FLOAT:\n                return Types.FLOAT;\n            case DOUBLE:\n                return Types.DOUBLE;\n            case BOOLEAN:\n                return Types.BOOLEAN;\n            case NULL:\n                return Types.VOID;\n        }\n        throw new IllegalArgumentException(\"Unsupported Avro type '\" + schema.getType() + \"'.\");\n    }\n\n    /**\n     * Converts an Avro schema string into a nested row structure with deterministic field order and\n     * data types that are compatible with Flink's Table & SQL API.\n     *\n     * @param avroSchemaString Avro schema definition string\n     * @return data type matching the schema\n     */\n    public static DataType convertToDataType(String avroSchemaString) {\n        return convertToDataType(avroSchemaString, true);\n    }\n\n    /**\n     * Converts an Avro schema string into a nested row structure with deterministic field order and\n     * data types that are compatible with Flink's Table & SQL API.\n     *\n     * @param avroSchemaString Avro schema definition string","sourceCodeStart":208,"sourceCodeEnd":244,"githubUrl":"https://github.com/apache/flink/blob/2f3c205e9266cb30240eb7f4fdab15cad629a70f/flink-formats/flink-avro/src/main/java/org/apache/flink/formats/avro/typeutils/AvroSchemaConverter.java#L208-L244","documentation":"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.","triggerScenarios":"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.","commonSituations":"Schemas generated by avro-tools decimal encoding (fixed-length bytes) or other tools that prefer fixed; legacy schemas using fixed for binary blobs.","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."],"exampleFix":"// before\n{\"name\":\"price\",\"type\":{\"type\":\"fixed\",\"name\":\"D128\",\"size\":16,\"logicalType\":\"decimal\",\"precision\":38,\"scale\":18}}\n\n// after\n{\"name\":\"price\",\"type\":{\"type\":\"bytes\",\"logicalType\":\"decimal\",\"precision\":38,\"scale\":18}}","handlingStrategy":"validation","validationCode":"static void validateNoFixed(Schema s) {\n    if (s.getType() == Schema.Type.FIXED) {\n        throw new IllegalArgumentException(\"FIXED type unsupported by AvroSchemaConverter: \" + s.getName());\n    }\n    if (s.getType() == Schema.Type.RECORD) {\n        s.getFields().forEach(f -> validateNoFixed(f.schema()));\n    }\n    if (s.getType() == Schema.Type.UNION) s.getTypes().forEach(SchemaValidator::validateNoFixed);\n    if (s.getType() == Schema.Type.ARRAY) validateNoFixed(s.getElementType());\n    if (s.getType() == Schema.Type.MAP) validateNoFixed(s.getValueType());\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["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."],"tags":["avro","flink","fixed-type","type-mapping","schema"],"backgroundTag":null,"analyzedSha":"2f3c205e9266cb30240eb7f4fdab15cad629a70f","analyzedAt":"2026-08-14T08:48:24.518Z","schemaVersion":2},"datasetVersion":"2026-08-14T10:17:34.591Z"}