apache/seatunnel · error · SeaTunnelRuntimeException

COMMON-19

COMMON-19

Error message

'${identifier}' unsupported convert SeaTunnel data type '${dataType}' of '${field}' to connector data type.

What it means

StarRocksDataTypeConvertor.toConnectorType() maps a SeaTunnel SQL type (SqlType enum) to a MySQL-compatible MysqlType used by the legacy StarRocks catalog. It supports a fixed whitelist (STRING, BOOLEAN, numeric, DECIMAL, BYTES, DATE/TIME/TIMESTAMP, and container types mapped to VARCHAR). Any SqlType outside the switch falls to the default branch, which throws this error naming the identifier 'StarRocks', the offending sqlType, and the field name.

Source

Thrown at seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/catalog/StarRocksDataTypeConvertor.java:194

                return MysqlType.BIGINT;
            case FLOAT:
                return MysqlType.FLOAT;
            case DOUBLE:
                return MysqlType.DOUBLE;
            case DECIMAL:
                return MysqlType.DECIMAL;
            case NULL:
                return MysqlType.NULL;
            case BYTES:
                return MysqlType.BIT;
            case DATE:
                return MysqlType.DATE;
            case TIME:
                return MysqlType.DATETIME;
            case TIMESTAMP:
                return MysqlType.TIMESTAMP;
            default:
                throw CommonError.convertToConnectorTypeError(
                        "StarRocks", sqlType.toString(), field);
        }
    }

    @Override
    public String getIdentity() {
        return "StarRocks";
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Inspect the failing field's SeaTunnel SqlType and cast/transform it to a supported type (STRING/INT/BIGINT/DOUBLE/DECIMAL/DATE/TIMESTAMP) before the StarRocks sink.
  2. Upgrade SeaTunnel to a version where the StarRocks type converter supports the type, or use the StarRocksTypeConverter (datatypes package) path which supports ARRAY/MAP natively.
  3. Pre-create the StarRocks table with a compatible schema so the connector does not need to auto-convert the unmapped type.
  4. If the type genuinely should be supported, extend the switch in StarRocksDataTypeConvertor.toConnectorType() with a mapping.

Example fix

// before: sink receives an unmapped type (e.g. ROW)
rowColumn -> StarRocks sink -> CommonError.convertToConnectorTypeError
// after: cast to a supported type upstream
SeaTunnelRowType with STRING column, or in a transform map the field to BasicType.STRING_TYPE
Defensive patterns

Strategy: validation

Validate before calling

// before sink/table-creation, verify every column type is convertible
java.util.Set<SqlType> supported = java.util.Set.of(
    SqlType.ARRAY, SqlType.MAP, SqlType.ROW, SqlType.STRING, SqlType.BOOLEAN,
    SqlType.TINYINT, SqlType.SMALLINT, SqlType.INT, SqlType.BIGINT,
    SqlType.FLOAT, SqlType.DOUBLE, SqlType.DECIMAL, SqlType.NULL,
    SqlType.BYTES, SqlType.DATE, SqlType.TIME, SqlType.TIMESTAMP);
for (Column c : rowType.getColumns()) {
    if (!supported.contains(c.getDataType().getSqlType()))
        throw new IllegalStateException("Unsupported for StarRocks: " + c.getName());
}

Type guard

static boolean isStarRocksConvertible(SeaTunnelDataType<?> t) {
    switch (t.getSqlType()) {
        case ARRAY: case MAP: case ROW: case STRING: case BOOLEAN:
        case TINYINT: case SMALLINT: case INT: case BIGINT:
        case FLOAT: case DOUBLE: case DECIMAL: case NULL: case BYTES:
        case DATE: case TIME: case TIMESTAMP:
            return true;
        default:
            return false;
    }
}

Try / catch

try {
    catalog.toConnectorType(field, dataType, props);
} catch (Exception e) {
    LOG.error("Field {} type {} not convertible to StarRocks; cast to STRING upstream", field, dataType, e);
    throw e;
}

Prevention

When it happens

Trigger: Calling toConnectorType(field, seaTunnelDataType, properties) with a SeaTunnel data type whose getSqlType() is not in the switch (e.g. a ROW/struct in paths not handled, or a new SqlType added to SeaTunnel API but not yet mapped here); table creation/sink schema translation through the legacy StarRocks catalog when a column carries an unmapped type.

Common situations: Using the legacy StarRocks catalog to auto-create tables from a source schema that contains types the converter has not mapped; running an older SeaTunnel build against schemas produced by newer versions that introduce new SqlType values; custom transforms emitting exotic column types before the StarRocks sink.

Related errors


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