apache/seatunnel · error · DatabendConnectorException

UNSUPPORTED_DATA_TYPE

UNSUPPORTED_DATA_TYPE

Error message

Unsupported data type: {dataType.getSqlType()}

What it means

DatabendCatalog.toDatabendTypeString encountered a SeaTunnel data type it cannot map to a Databend column type string. The method only handles a fixed set of supported types and throws in its default branch when the mapping is unknown, e.g. TIME or complex/array/map types. This prevents generating an invalid CREATE TABLE statement.

Source

Thrown at seatunnel-connectors-v2/connector-databend/src/main/java/org/apache/seatunnel/connectors/seatunnel/databend/catalog/DatabendCatalog.java:454

            case DOUBLE:
                return "DOUBLE";
            case DECIMAL:
                DecimalType decimalType = (DecimalType) dataType;
                return String.format(
                        "DECIMAL(%d, %d)", decimalType.getPrecision(), decimalType.getScale());
            case BYTES:
                return "VARBINARY";
            case STRING:
                return "VARCHAR";
            case DATE:
                return "DATE";
            case TIME:
                return "TIME";
            case TIMESTAMP:
                LocalTimeType timeType = (LocalTimeType) dataType;
                return "TIMESTAMP";
            default:
                throw new DatabendConnectorException(
                        DatabendConnectorErrorCode.UNSUPPORTED_DATA_TYPE,
                        "Unsupported data type: " + dataType.getSqlType());
        }
    }

    private SeaTunnelDataType<?> convertDatabendType(
            String typeName, int sqlType, int columnSize, int decimalDigits) {
        // This method should convert Databend data types to SeaTunnel data types
        // This is a simplified version, you'll need to adjust based on Databend's actual type
        // system
        typeName = typeName.toUpperCase();

        switch (typeName) {
            case "BOOLEAN":
                return BasicType.BOOLEAN_TYPE;
            case "TINYINT":
            case "INT8":
                return BasicType.BYTE_TYPE;

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Cast or transform the offending column to a supported type (e.g. map TIME to TIMESTAMP/DATETIME, flatten nested types) before writing to Databend
  2. Update the source config to exclude or convert unsupported columns
  3. Extend toDatabendTypeString with a case for the missing SqlType if you maintain the connector

Example fix

// before: schema contains TIME -> throws at default branch
case TIME:
    return "TIME";
// after: map TIME to a Databend-supported type
case TIME:
    return "TIMESTAMP";
Defensive patterns

Strategy: validation

Validate before calling

switch (dataType.getSqlType()) {
    case STRING: case INT: case BIGINT: case TIMESTAMP:
        break;
    default:
        throw new IllegalArgumentException(
            "Column type not supported by Databend sink: " + dataType.getSqlType());
}

Type guard

boolean isSupported(SeaTunnelDataType<?> t) {
    return t instanceof BasicType || t instanceof LocalTimeType;
}

Prevention

When it happens

Trigger: Calling buildCreateTableSql (via catalog.createTable) when the CatalogTable schema contains a type outside the supported set, such as LocalTimeType.TIME, ARRAY, MAP, or ROW types.

Common situations: Source tables with TIME or nested (array/map/struct) columns being synced into Databend; schema inferred from a source connector that produces types Databend's type converter lacks cases for.

Related errors


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