{"record":{"id":"1d991582af2e1115","repo":"apache/seatunnel","slug":"unsupported-data-type-1d9915","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/SeaTunnelRowTypeToAvroSchemaConverter.java","lineNumber":126,"sourceCode":"                        Schema.create(Schema.Type.NULL),\n                        decimal.addToSchema(Schema.create(Schema.Type.BYTES)));\n            case TIMESTAMP:\n                return Schema.createUnion(\n                        Schema.create(Schema.Type.NULL),\n                        LogicalTypes.localTimestampMillis()\n                                .addToSchema(Schema.create(Schema.Type.LONG)));\n            case DATE:\n                return Schema.createUnion(\n                        Schema.create(Schema.Type.NULL),\n                        LogicalTypes.date().addToSchema(Schema.create(Schema.Type.INT)));\n            case NULL:\n                return Schema.create(Schema.Type.NULL);\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":108,"sourceCodeEnd":131,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-formats/seatunnel-format-avro/src/main/java/org/apache/seatunnel/format/avro/SeaTunnelRowTypeToAvroSchemaConverter.java#L108-L131","documentation":"SeaTunnelAvroFormatException with code UNSUPPORTED_DATA_TYPE thrown by SeaTunnelRowTypeToAvroDataTypeConverter.seaTunnelDataType2AvroDataType when building the Avro schema from a SeaTunnelRowType containing a type with no Avro mapping. Schema construction fails before any data is written, so jobs fail at setup rather than mid-stream.","triggerScenarios":"Generating an Avro schema for a SeaTunnelRowType whose field list includes a SqlType not covered by seaTunnelDataType2AvroDataType's switch (e.g. MAP, or time types depending on version); commonly via generateValidSchema during serialization setup.","commonSituations":"Configuring an Avro sink/format for a table with complex column types; schema drift after adding columns of new types; older SeaTunnel versions with narrower Avro type support.","solutions":["Check the unsupported SqlType in the message and change the column to a supported type","Cast/convert the offending column (e.g. to STRING or a primitive) upstream of the format","Upgrade to a SeaTunnel release that supports the type in Avro schema conversion","Extend the converter switch if working in-tree"],"exampleFix":"// before\nnew SeaTunnelRowType(new String[]{\"tm\"}, new SeaTunnelDataType<?>[]{new MapType<>(STRING_TYPE, STRING_TYPE)});\n// after\nnew SeaTunnelRowType(new String[]{\"tm\"}, new SeaTunnelDataType<?>[]{STRING_TYPE}); // map serialized as JSON string","handlingStrategy":"validation","validationCode":"// fail fast at schema generation time\ntry {\n    Schema s = SeaTunnelRowTypeToAvroSchemaConverter.generateValidSchema(rowType, \"name\", \"ns\");\n} catch (SeaTunnelAvroFormatException e) {\n    throw new IllegalArgumentException(\"Retype unsupported column: \" + e.getMessage());\n}","typeGuard":null,"tryCatchPattern":"try {\n    schema = SeaTunnelRowTypeToAvroSchemaConverter.generateValidSchema(rowType, name, ns);\n} catch (SeaTunnelAvroFormatException e) {\n    LOG.error(\"Avro schema generation failed for type: {}\", e.getMessage());\n    throw e; // schema errors should fail setup, not be retried\n}","preventionTips":["Generate and validate the Avro schema during job planning, before data flows","Keep row types restricted to SqlTypes with known Avro mappings","Convert unsupported columns (e.g. MAP -> JSON STRING) upstream","Test schema generation for all tables in your config suite"],"tags":["java","avro","schema","unsupported-type"],"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"}