apache/seatunnel · error · SeaTunnelRuntimeException
COMMON-17
COMMON-17
Error message
'${identifier}' unsupported convert type '${dataType}' of '${field}' to SeaTunnel data type. What it means
PostgresTypeConverter.convert() throws this when a PostgreSQL column type cannot be mapped to a SeaTunnel type. The default branch maps Types.OTHER columns to STRING, but any other unrecognized type falls through to CommonError.convertToSeaTunnelTypeError with the Postgres identifier.
Source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/psql/PostgresTypeConverter.java:293
builder.scale(typeDefine.getScale());
}
break;
case PG_TIMESTAMP_TZ:
// timestamptz -> TIMESTAMP_TZ
builder.dataType(LocalTimeType.OFFSET_DATE_TIME_TYPE);
if (typeDefine.getScale() != null && typeDefine.getScale() > MAX_TIMESTAMP_SCALE) {
builder.scale(MAX_TIMESTAMP_SCALE);
} else {
builder.scale(typeDefine.getScale());
}
break;
default:
if (typeDefine.getSqlType() == Types.OTHER) {
builder.dataType(BasicType.STRING_TYPE);
builder.sourceType(typeDefine.getColumnType());
break;
}
throw CommonError.convertToSeaTunnelTypeError(
identifier(), typeDefine.getDataType(), typeDefine.getName());
}
return builder.build();
}
@Override
public BasicTypeDefine reconvert(Column column) {
BasicTypeDefine.BasicTypeDefineBuilder builder =
BasicTypeDefine.builder()
.name(column.getName())
.nullable(column.isNullable())
.comment(column.getComment())
.defaultValue(column.getDefaultValue());
switch (column.getDataType().getSqlType()) {
case BOOLEAN:
builder.columnType(PG_BOOLEAN);
builder.dataType(PG_BOOLEAN);
break;View on GitHub (pinned to cf67b549a7)
Solutions
- CAST the offending column in the query (e.g. to TEXT or a numeric type)
- Check the driver/SeaTunnel version — upgrade to one that handles the type
- Wrap custom extension columns as TEXT (e.g. geometry::text)
Example fix
// before: SELECT geom FROM places (PostGIS geometry) // after String query = "SELECT ST_AsText(geom) AS geom FROM places";
Defensive patterns
Strategy: validation
Validate before calling
// Check column JDBC types are convertible before reading:
ResultSet cols = meta.getColumns(null, schema, table, null);
while (cols.next()) {
int jdbcType = cols.getInt("DATA_TYPE");
if (jdbcType == Types.OTHER || jdbcType == Types.STRUCT || jdbcType == Types.ARRAY) {
LOG.warn("Column {} may need a CAST: {}", cols.getString("COLUMN_NAME"), cols.getString("TYPE_NAME"));
}
} Try / catch
try {
CatalogTable table = converter.convert(typeDefinition);
} catch (SeaTunnelRuntimeException e) {
LOG.warn("Unsupported Postgres type, cast or exclude the column: {}", e.getMessage());
// fall back to TEXT cast via custom query
} Prevention
- Cast custom/extension types (postgis, custom composites) to text/bytea in queries
- Verify with a SELECT * metadata probe before production
- Upgrade the connector when using newer Postgres types
When it happens
Trigger: Reading a Postgres table whose column has a JDBC type not handled by convert() and not Types.OTHER — e.g. custom enum domains surfaced differently, geometric/JSON types on unhandled drivers, or PG array types the converter predates.
Common situations: Tables with custom types/extensions (postgis geometry on old drivers, custom composite types), or newer Postgres versions introducing types unknown to the connector; schema read fails during job initialization.
Related errors
- COMMON-19
- The DB connection is not a valid replication connection
- Unable to parse create_replication_slot response
- Read the binlog offset error
- SQL_OPERATION_FAILED
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/1b7c50e46a5bd83f.
Report an issue: GitHub.