{"record":{"id":"544fe81697c0ec88","repo":"apache/seatunnel","slug":"orc-does-not-support-null-type","errorCode":null,"errorMessage":"Orc does not support NULL type","messagePattern":"Orc does not support NULL 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":154,"sourceCode":"                    org.apache.seatunnel.api.table.type.MapType<?, ?> mapType =\n                            (org.apache.seatunnel.api.table.type.MapType<?, ?>) seaTunnelType;\n                    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":136,"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#L136-L163","documentation":"The Hive ORC type conversion path does not support SeaTunnel's NULL SqlType: there is no equivalent Hive column type for a null-only type, so seatunnelToHiveType throws UnsupportedOperationException with 'Orc does not support NULL type'.","triggerScenarios":"Calling seatunnelToHiveType on a type whose getSqlType() is SqlType.NULL — e.g. a catalog schema containing a NULL-typed column, or a schema inferred entirely from null values.","commonSituations":"Schema inference produced BasicType.VOID_TYPE for a column where all sample values were null; a source schema explicitly declaring VOID for a field that is written into a Hive ORC table.","solutions":["Assign a concrete type (e.g. STRING) to the column instead of VOID/NULL in the schema.","Cast or transform the NULL-typed field in a preceding SeaTunnel transform to a concrete type.","Fix the schema-inference logic that produced the NULL type."],"exampleFix":"// before\nnew SeaTunnelRowType(new String[]{\"v\"}, new SeaTunnelDataType<?>[]{BasicType.VOID_TYPE});\n// after\nnew SeaTunnelRowType(new String[]{\"v\"}, new SeaTunnelDataType<?>[]{BasicType.STRING_TYPE});","handlingStrategy":"validation","validationCode":"for (SeaTunnelDataType<?> t : rowType.getFieldTypes()) {\n    if (t.getSqlType() == SqlType.NULL || t.getSqlType() == SqlType.VOID) {\n        throw new IllegalArgumentException(\"Hive ORC sink does not support NULL/VOID column type\");\n    }\n}","typeGuard":"static boolean isHiveConvertible(SeaTunnelDataType<?> t) {\n    return t.getSqlType() != SqlType.NULL && t.getSqlType() != SqlType.VOID;\n}","tryCatchPattern":"try {\n    String hiveType = HiveTypeConvertor.seatunnelToHiveType(type);\n} catch (UnsupportedOperationException e) {\n    if (e.getMessage().contains(\"does not support NULL type\")) {\n        // substitute a concrete type (e.g. STRING) for the VOID column\n    }\n    throw e;\n}","preventionTips":["Never leave inferred NULL/VOID columns in schemas destined for Hive.","Coerce all-null inferred fields to a concrete type during schema inference.","Add a schema check step before writing to Hive sinks."],"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-14T11:17:12.474Z"}