apache/seatunnel · error · FileConnectorException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

Orc file not support this type [%s]

What it means

Thrown by OrcWriteStrategy.buildFieldWithRowType when a SeaTunnel column type cannot be mapped to an ORC TypeDescription. Only known types (INT, STRING, MAP, LIST, STRUCT, etc.) are supported; SQL type NULL and any unmapped/default type reach the default branch and abort schema construction.

Source

Thrown at seatunnel-connectors-v2/connector-file/connector-file-base/src/main/java/org/apache/seatunnel/connectors/seatunnel/file/sink/writer/OrcWriteStrategy.java:224

            case DATE:
                return TypeDescription.createDate();
            case TIME:
            case TIMESTAMP:
                return TypeDescription.createTimestamp();
            case ROW:
                TypeDescription struct = TypeDescription.createStruct();
                SeaTunnelDataType<?>[] fieldTypes = ((SeaTunnelRowType) type).getFieldTypes();
                for (int i = 0; i < fieldTypes.length; i++) {
                    struct.addField(
                            ((SeaTunnelRowType) type).getFieldName(i),
                            buildFieldWithRowType(fieldTypes[i]));
                }
                return struct;
            case NULL:
            default:
                String errorMsg =
                        String.format("Orc file not support this type [%s]", type.getSqlType());
                throw new FileConnectorException(
                        CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE, errorMsg);
        }
    }

    private TypeDescription buildSchemaWithRowType() {
        TypeDescription schema = TypeDescription.createStruct();
        for (Integer i : sinkColumnsIndexInRow) {
            TypeDescription fieldType = buildFieldWithRowType(seaTunnelRowType.getFieldType(i));
            schema.addField(seaTunnelRowType.getFieldName(i).toLowerCase(), fieldType);
        }
        return schema;
    }

    private void setColumn(Object value, ColumnVector vector, int row) {
        if (value == null) {
            vector.isNull[row] = true;
            vector.noNulls = false;
        } else {

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Remove or replace NULL/unsupported typed columns in the upstream schema before the ORC sink (use a transform to cast to STRING or drop the column)
  2. Explicitly declare sink columns with supported ORC-mappable types instead of relying on schema auto-derivation
  3. Check the source connector's produced SeaTunnelRowType for unmapped SqlTypes and upgrade/patch that connector
  4. Extend the type mapping switch in a custom write strategy if you need the type

Example fix

// before
Column c = new Column("extra", SeaTunnelRowType.NULL, 0); // reaches default branch
// after
Column c = new Column("extra", BasicType.STRING_TYPE, 0); // cast value to string upstream
Defensive patterns

Strategy: validation

Validate before calling

// validate all sink columns are ORC-mappable before the job
List<SqlType> bad = rowType.getFieldTypes().stream()
    .map(t -> ((SeaTunnelDataType<?>) t).getSqlType())
    .filter(t -> t == SqlType.NULL)
    .collect(Collectors.toList());
if (!bad.isEmpty()) throw new IllegalArgumentException("Unmappable ORC columns: " + bad);

Type guard

boolean isOrcMappable(SqlType t) {
    return t != SqlType.NULL; // and not in connector's known-unmapped set
}

Try / catch

try {
    orcSink.write(row);
} catch (FileConnectorException e) {
    if (CommonErrorCodeDeprecated.UNSUPPORTED_DATA_TYPE.equals(e.getErrorCode())
            && e.getMessage().startsWith("Orc file not support")) {
        // add a transform to cast/drop the offending column, rerun
    }
}

Prevention

When it happens

Trigger: Source SeaTunnelRowType contains a column whose SqlType is NULL or otherwise not in the ORC mapping switch (e.g. an unsupported/unknown type from a custom or auto-generated schema).

Common situations: Sink schema auto-derived from a source that emits SeaTunnelRow.NULL / unknown types; transform added a column with an exotic type; custom serializer returning unmapped SqlTypes; using `null` typed placeholder columns in config.

Related errors


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