{"record":{"id":"1e12d8f708c9e426","repo":"apache/seatunnel","slug":"unsupported-type-conversion-from-s-to-hive-orc-ty","errorCode":null,"errorMessage":"Unsupported type conversion from %s to Hive ORC type","messagePattern":"Unsupported type conversion from (.+?) to Hive ORC type","errorType":"exception","errorClass":"UnsupportedOperationException","httpStatus":null,"severity":"error","filePath":"seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveTypeConvertor.java","lineNumber":156,"sourceCode":"                    org.apache.seatunnel.api.table.type.SeaTunnelDataType<?> keyType =\n                            mapType.getKeyType();\n                    org.apache.seatunnel.api.table.type.SeaTunnelDataType<?> valueType =\n                            mapType.getValueType();\n                    if (keyType == null || valueType == null) {\n                        throw new UnsupportedOperationException(\n                                \"MAP type requires key and value types\");\n                    }\n                    return \"map<\"\n                            + seatunnelToHiveType(keyType)\n                            + \",\"\n                            + seatunnelToHiveType(valueType)\n                            + \">\";\n                }\n                throw new UnsupportedOperationException(\"MAP type requires key and value types\");\n            case NULL:\n                throw new UnsupportedOperationException(\"Orc does not support NULL type\");\n            default:\n                throw new UnsupportedOperationException(\n                        String.format(\n                                \"Unsupported type conversion from %s to Hive ORC type\",\n                                seaTunnelType.getSqlType()));\n        }\n    }\n}\n","sourceCodeStart":138,"sourceCodeEnd":163,"githubUrl":"https://github.com/apache/seatunnel/blob/cf67b549a7a6c35fa0beb12d83c62892427ea919/seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveTypeConvertor.java#L138-L163","documentation":"Default branch of seatunnelToHiveType's switch: any SeaTunnel SqlType without an explicit Hive (ORC) mapping hits this and throws UnsupportedOperationException formatted with the offending SqlType. It signals the Hive ORC writer cannot represent that type.","triggerScenarios":"Calling seatunnelToHiveType with an unmapped SqlType (e.g. complex or newer types not covered by the switch cases) — the message's %s is filled with seaTunnelType.getSqlType().","commonSituations":"Introducing a column with a recently added SqlType into a Hive sink schema; upgrading SeaTunnel and using a new type before the Hive type converter gained a mapping.","solutions":["Change the offending column to a supported type (primitives, STRING, struct, array, map).","Add a mapping case for the SqlType in HiveTypeConvertor.seatunnelToHiveType if the equivalent Hive type exists.","Use a transform to cast the field to a supported type before the Hive sink."],"exampleFix":"// before\n// switch has no case for SqlType.ROW_WITH_METADATA\n// after\ncase ROW_WITH_METADATA:\n    return seatunnelToHiveType(...); // or map to an existing supported type","handlingStrategy":"validation","validationCode":"static final Set<SqlType> HIVE_SUPPORTED = Set.of(\n    SqlType.STRING, SqlType.BOOLEAN, SqlType.TINYINT, SqlType.SMALLINT,\n    SqlType.INT, SqlType.BIGINT, SqlType.FLOAT, SqlType.DOUBLE,\n    SqlType.DATE, SqlType.TIMESTAMP, SqlType.ROW, SqlType.ARRAY, SqlType.MAP);\nif (!HIVE_SUPPORTED.contains(type.getSqlType())) {\n    throw new IllegalArgumentException(\"Type not supported by Hive converter: \" + type.getSqlType());\n}","typeGuard":null,"tryCatchPattern":"try {\n    String hiveType = HiveTypeConvertor.seatunnelToHiveType(type);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().startsWith(\"Unsupported type conversion\")) {\n        // log type.getSqlType() and cast/drop the field in a transform\n    }\n    throw e;\n}","preventionTips":["Keep sink schemas limited to types the Hive converter maps.","Insert a SeaTunnel transform to cast exotic types before the Hive sink.","After upgrading SeaTunnel, diff new SqlTypes against the Hive converter's switch."],"tags":["hive","orc","type-conversion","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-14T05:17:10.506Z"}