{"record":{"id":"5d997a6d65a6c924","repo":"apache/seatunnel","slug":"common-17-5d997a","errorCode":"COMMON-17","errorMessage":"'<identifier>' unsupported convert type '<dataType>' of '<field>' to SeaTunnel data type.","messagePattern":"'<identifier>' unsupported convert type '<dataType>' of '<field>' to SeaTunnel data type\\.","errorType":"error_code","errorClass":"org.apache.seatunnel.common.exception.SeaTunnelRuntimeException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/util/SchemaUtil.java","lineNumber":101,"sourceCode":"                return BasicType.LONG_TYPE;\n            case FLOAT:\n                return BasicType.FLOAT_TYPE;\n            case DOUBLE:\n                return BasicType.DOUBLE_TYPE;\n            case BOOLEAN:\n                return BasicType.BOOLEAN_TYPE;\n            case UNION:\n                final Schema actualSchema;\n                if (schema.getTypes().size() == 2\n                        && schema.getTypes().get(0).getType() == Schema.Type.NULL) {\n                    actualSchema = schema.getTypes().get(1);\n                } else if (schema.getTypes().size() == 2\n                        && schema.getTypes().get(1).getType() == Schema.Type.NULL) {\n                    actualSchema = schema.getTypes().get(0);\n                } else if (schema.getTypes().size() == 1) {\n                    actualSchema = schema.getTypes().get(0);\n                } else {\n                    throw CommonError.convertToSeaTunnelTypeError(\n                            \"Hudi\", schema.getType().name(), field);\n                }\n                return convertSeaTunnelType(field, actualSchema);\n            default:\n                throw CommonError.convertToSeaTunnelTypeError(\n                        \"Hudi\", schema.getType().name(), field);\n        }\n    }\n\n    private static MapType convertMapType(String field, Schema schema) {\n        return new MapType(\n                convertSeaTunnelType(field, schema.getElementType()),\n                convertSeaTunnelType(field, schema.getValueType()));\n    }\n\n    private static SeaTunnelRowType convertStructType(Schema schema) {\n        List<Schema.Field> fields = schema.getFields();\n        List<String> fieldNames = new ArrayList<>(fields.size());","sourceCodeStart":83,"sourceCodeEnd":119,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hudi/src/main/java/org/apache/seatunnel/connectors/seatunnel/hudi/util/SchemaUtil.java#L83-L119","documentation":"SchemaUtil.convertSeaTunnelType maps Avro (Hudi) schemas to SeaTunnel types. When a UNION schema has more than two branches, or the two-branch union's non-null branch cannot be resolved as expected, it throws COMMON-17 convertToSeaTunnelTypeError with the Hudi identifier, the schema type name, and the field. Only single-type and simple nullable unions (type|null) are supported.","triggerScenarios":"A Hudi (Avro) record field has a union schema with 3+ member types, or a 2-member union whose second type is not NULL, so no 'actualSchema' can be picked.","commonSituations":"Hudi tables written by engines that produce multi-branch unions (e.g. int|long|null, enum unions); schema evolution merging several historical types into one field.","solutions":["Normalize the Hudi/Avro schema so unions are at most 'type|null' (rewrite table schema or use a schema that collapses branches)","Change the field type on write so it is a single concrete type","Pre-process the Avro schema before conversion by patching SchemaUtil usage (custom build)","Report/track support for multi-branch Avro union conversion in SeaTunnel"],"exampleFix":"// before\n\"field\": [\"int\", \"long\", \"null\"]\n// after\n\"field\": [\"long\", \"null\"]","handlingStrategy":"validation","validationCode":"// Inspect Avro union branches of the Hudi schema before conversion\nfor (Schema.Field f : avroSchema.getFields()) {\n    if (f.schema().getType() == Schema.Type.UNION\n            && f.schema().getTypes().size() > 2) {\n        throw new IllegalArgumentException(\n            \"Field \" + f.name() + \" has unsupported multi-branch union\");\n    }\n}","typeGuard":"boolean isSimpleNullableUnion(Schema s) {\n    return s.getType() == Schema.Type.UNION\n        && (s.getTypes().size() == 1\n            || (s.getTypes().size() == 2\n                && s.getTypes().get(1).getType() == Schema.Type.NULL));\n}","tryCatchPattern":null,"preventionTips":["Keep Avro unions limited to '<type>|null' when writing Hudi tables","Avoid letting schema evolution merge multiple concrete types into one field","Inspect the table's Avro schema (avro reader) before configuring the source","Pin writer versions that produce canonical nullable unions"],"tags":["hudi","avro","type-conversion","union"],"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"}