{"record":{"id":"3c383b54846cdf5c","repo":"apache/seatunnel","slug":"unsupported-data-type-3c383b","errorCode":"UNSUPPORTED_DATA_TYPE","errorMessage":"SeaTunnel avro format is not supported for this data type [${sqlType}]","messagePattern":"SeaTunnel avro format is not supported for this data type \\[(.+?)\\]","errorType":"error_code","errorClass":"SeaTunnelAvroFormatException","httpStatus":null,"severity":"error","filePath":"seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/RowToAvroConverter.java","lineNumber":158,"sourceCode":"                SeaTunnelRow seaTunnelRow = (SeaTunnelRow) data;\n                SeaTunnelDataType<?>[] fieldTypes =\n                        ((SeaTunnelRowType) seaTunnelDataType).getFieldTypes();\n                String[] fieldNames = ((SeaTunnelRowType) seaTunnelDataType).getFieldNames();\n                Schema recordSchema =\n                        SeaTunnelRowTypeToAvroSchemaConverter.buildAvroSchemaWithRowType(\n                                (SeaTunnelRowType) seaTunnelDataType);\n                GenericRecordBuilder recordBuilder = new GenericRecordBuilder(recordSchema);\n                for (int i = 0; i < fieldNames.length; i++) {\n                    recordBuilder.set(\n                            fieldNames[i], resolveObject(seaTunnelRow.getField(i), fieldTypes[i]));\n                }\n                return recordBuilder.build();\n            default:\n                String errorMsg =\n                        String.format(\n                                \"SeaTunnel avro format is not supported for this data type [%s]\",\n                                seaTunnelDataType.getSqlType());\n                throw new SeaTunnelAvroFormatException(\n                        AvroFormatErrorCode.UNSUPPORTED_DATA_TYPE, errorMsg);\n        }\n    }\n}\n","sourceCodeStart":140,"sourceCodeEnd":163,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/RowToAvroConverter.java#L140-L163","documentation":"SeaTunnelAvroFormatException with code UNSUPPORTED_DATA_TYPE thrown by RowToAvroConverter.resolveObject when converting a SeaTunnelRow field value into an Avro object for a type the switch doesn't implement. Serialization counterpart of AvroToRowConverter's check: the row type contains a SqlType the avro format cannot encode into a GenericRecord.","triggerScenarios":"Calling AvroSerializationSchema on a row whose SeaTunnelRowType includes a data type not handled in resolveObject's switch (e.g. MAP or other complex types depending on version).","commonSituations":"Sinking data with MAP/complex columns through the Avro format; upstream schema evolution introducing unsupported types; using avro format where JSON/other format would be appropriate.","solutions":["Identify the unsupported SqlType from the error message and remove/retype that column","Flatten MAP fields or encode them as JSON STRING before conversion","Use a different format (e.g. JSON) for schemas with unsupported types","Upgrade SeaTunnel or contribute a converter branch for the missing type"],"exampleFix":"// before\n// rowType contains MapType<STRING, INT> -> hits default branch\n// after\nString json = mapToJson(mapField);\nrow.setField(i, json); // encode as STRING","handlingStrategy":"validation","validationCode":"// validate row type against Avro-supported types before serializing\nfor (SeaTunnelDataType<?> t : rowType.getFieldTypes()) {\n    switch ((SqlType) t.getSqlType()) {\n        case STRING: case BOOLEAN: case TINYINT: case SMALLINT: case INT:\n        case BIGINT: case FLOAT: case DOUBLE: case BYTES: case ROW:\n        case ARRAY: case DATE: case TIMESTAMP: case DECIMAL: case NULL: break;\n        default: throw new IllegalArgumentException(\"Avro-unsupported: \" + t.getSqlType());\n    }\n}","typeGuard":null,"tryCatchPattern":"try {\n    byte[] bytes = serializationSchema.serialize(row);\n} catch (SeaTunnelAvroFormatException e) {\n    if (e.getFormatErrorCode() == AvroFormatErrorCode.UNSUPPORTED_DATA_TYPE)\n        LOG.error(\"Cannot encode sqlType, retype or flatten the column\", e);\n    throw e;\n}","preventionTips":["Pre-check the row type against supported SqlTypes at job config time","Flatten or stringify complex types (MAP etc.) before Avro serialization","Consider JSON format for schemas with unsupported complex types","Pin the SeaTunnel version and its documented Avro type matrix"],"tags":["java","avro","unsupported-type","serialization"],"backgroundTag":"unsupported-dtype","analyzedSha":"cf67b549a7a6c35fa0beb12d83c62892427ea919","analyzedAt":"2026-09-10T21:44:55.265Z","contentChangedAt":"2026-09-10T21:44:55.265Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}