apache/seatunnel · error · UnsupportedOperationException

Orc does not support NULL type

Error message

Orc does not support NULL type

What it means

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'.

Source

Thrown at seatunnel-connectors-v2/connector-hive/src/main/java/org/apache/seatunnel/connectors/seatunnel/hive/utils/HiveTypeConvertor.java:154

                    org.apache.seatunnel.api.table.type.MapType<?, ?> mapType =
                            (org.apache.seatunnel.api.table.type.MapType<?, ?>) seaTunnelType;
                    org.apache.seatunnel.api.table.type.SeaTunnelDataType<?> keyType =
                            mapType.getKeyType();
                    org.apache.seatunnel.api.table.type.SeaTunnelDataType<?> valueType =
                            mapType.getValueType();
                    if (keyType == null || valueType == null) {
                        throw new UnsupportedOperationException(
                                "MAP type requires key and value types");
                    }
                    return "map<"
                            + seatunnelToHiveType(keyType)
                            + ","
                            + seatunnelToHiveType(valueType)
                            + ">";
                }
                throw new UnsupportedOperationException("MAP type requires key and value types");
            case NULL:
                throw new UnsupportedOperationException("Orc does not support NULL type");
            default:
                throw new UnsupportedOperationException(
                        String.format(
                                "Unsupported type conversion from %s to Hive ORC type",
                                seaTunnelType.getSqlType()));
        }
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Assign a concrete type (e.g. STRING) to the column instead of VOID/NULL in the schema.
  2. Cast or transform the NULL-typed field in a preceding SeaTunnel transform to a concrete type.
  3. Fix the schema-inference logic that produced the NULL type.

Example fix

// before
new SeaTunnelRowType(new String[]{"v"}, new SeaTunnelDataType<?>[]{BasicType.VOID_TYPE});
// after
new SeaTunnelRowType(new String[]{"v"}, new SeaTunnelDataType<?>[]{BasicType.STRING_TYPE});
Defensive patterns

Strategy: validation

Validate before calling

for (SeaTunnelDataType<?> t : rowType.getFieldTypes()) {
    if (t.getSqlType() == SqlType.NULL || t.getSqlType() == SqlType.VOID) {
        throw new IllegalArgumentException("Hive ORC sink does not support NULL/VOID column type");
    }
}

Type guard

static boolean isHiveConvertible(SeaTunnelDataType<?> t) {
    return t.getSqlType() != SqlType.NULL && t.getSqlType() != SqlType.VOID;
}

Try / catch

try {
    String hiveType = HiveTypeConvertor.seatunnelToHiveType(type);
} catch (UnsupportedOperationException e) {
    if (e.getMessage().contains("does not support NULL type")) {
        // substitute a concrete type (e.g. STRING) for the VOID column
    }
    throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10). Data as JSON: /api/errors/544fe81697c0ec88. Report an issue: GitHub.