apache/seatunnel · error · IllegalArgumentException

Unsupported SeaTunnel's data type: " + dataType

Error message

Unsupported SeaTunnel's data type: " + dataType

What it means

StarRocksSaveModeUtil.dataTypeToStarrocksType maps SeaTunnel column types to StarRocks SQL types when auto-creating tables. The mapping covers primitives, arrays, DecimalType and MAP/ROW (mapped to JSON); any other SeaTunnelDataType falls into the default branch and throws IllegalArgumentException. It indicates the sink cannot translate the column's type to a StarRocks equivalent.

Solutions

  1. Cast or transform the offending column upstream (e.g. with a SQL transform CAST to STRING) so it maps to a supported type.
  2. Check the switch in dataTypeToStarrocksType for the supported set and upgrade SeaTunnel if a newer version added the missing mapping.
  3. Define the target table schema explicitly in save-mode (schema_save_mode = CREATE_SCHEMA_WHEN_TABLE_NOT_EXIST with explicit columns) instead of relying on automatic type translation.

Example fix

// before
Transform\#sql "SELECT my_time_col FROM src"
// after
Transform\#sql "SELECT CAST(my_time_col AS STRING) AS my_time_col FROM src"
Defensive patterns

Strategy: validation

Validate before calling

// Pre-check each column type is supported by the StarRocks mapping
Set<String> supported = Set.of("STRING","BOOLEAN","TINYINT","SMALLINT","INT","BIGINT","FLOAT","DOUBLE","DECIMAL","DATE","TIMESTAMP","ARRAY","MAP","ROW","BYTES");
schema.forEach(f -> { if (!supported.contains(f.getDataType().getSqlType().name()))
    throw new IllegalStateException("Column " + f.getName() + " type not supported by StarRocks sink"); });

Type guard

function isStarRocksMappable(sqlType) {
  return ["STRING","BOOLEAN","TINYINT","SMALLINT","INT","BIGINT","FLOAT","DOUBLE","DECIMAL","DATE","TIMESTAMP","ARRAY","MAP","ROW","BYTES"].includes(sqlType);
}

Try / catch

try {
    createTableViaSaveMode(config, schema);
} catch (IllegalArgumentException e) {
    if (e.getMessage().startsWith("Unsupported SeaTunnel's data type")) {
        // cast offending column to STRING upstream and retry
    }
}

Prevention

When it happens

Trigger: Calling dataTypeToStarrocksType (via columnToConnectorType during save-mode table creation) with a SeaTunnel column whose SqlType is not covered by the switch — e.g. a newly added or less common type like TIME or NULL_TYPE reaching the default branch.

Common situations: Source schema auto-discovery produces a type (e.g. TIME, unknown vendor type) that the StarRocks sink type-mapping has no case for; new SeaTunnel version introduced a type not yet supported by this mapping; custom DataType used programmatically.

Related errors


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

Appendix: source

Thrown at seatunnel-connectors-v2/connector-starrocks/src/main/java/org/apache/seatunnel/connectors/seatunnel/starrocks/sink/StarRocksSaveModeUtil.java:175

            case DATE:
                return "DATE";
            case TIMESTAMP:
                return "DATETIME";
            case ARRAY:
                return "ARRAY<"
                        + dataTypeToStarrocksType(
                                ((ArrayType<?, ?>) dataType).getElementType(), Long.MAX_VALUE)
                        + ">";
            case DECIMAL:
                DecimalType decimalType = (DecimalType) dataType;
                return String.format(
                        "Decimal(%d, %d)", decimalType.getPrecision(), decimalType.getScale());
            case MAP:
            case ROW:
                return "JSON";
            default:
        }
        throw new IllegalArgumentException("Unsupported SeaTunnel's data type: " + dataType);
    }
}

View on GitHub (pinned to cf67b549a7)