apache/seatunnel · error · org.apache.seatunnel.common.exception.SeaTunnelRuntimeException
COMMON-19
COMMON-19
Error message
'<identifier>' unsupported convert SeaTunnel data type '<dataType>' of '<field>' to connector data type.
What it means
This error is thrown by DmdbTypeConverter.reconvert() when mapping a SeaTunnel data type back to a DM (Dameng) connector column type, typically when the sink creates the target table (auto table creation / schema evolution). Every SeaTunnel type the sink needs to write must have a case in reconvert's switch; unsupported types (e.g. SeaTunnel ARRAY/MAP/ROW composite types, or types the DM dialect has no DDL mapping for) fall through to the default branch and raise this error with the DAMENG identifier, the SeaTunnel type name, and the field name.
Source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/dm/DmdbTypeConverter.java:519
timestampTzScale = MAX_TIMESTAMP_SCALE;
log.warn(
"The timestamp_tz column {} type datetime_tz({}) is out of range, "
+ "which exceeds the maximum scale of {}, "
+ "it will be converted to datetime_tz({})",
column.getName(),
column.getScale(),
MAX_TIMESTAMP_SCALE,
timestampTzScale);
}
builder.columnType(
String.format("DATETIME(%s) WITH TIME ZONE", timestampTzScale));
builder.scale(timestampTzScale);
} else {
builder.columnType(DM_DATETIME_WITH_TIME_ZONE);
}
break;
default:
throw CommonError.convertToConnectorTypeError(
DatabaseIdentifier.DAMENG,
column.getDataType().toString(),
column.getName());
}
return builder.build();
}
}
View on GitHub (pinned to cf67b549a7)
Solutions
- Flatten or remove complex fields before the sink: use a transform (e.g. JsonPath/Replace or Filter/Sql transform) to convert ARRAY/MAP/ROW columns into scalar/string columns.
- Create the target DM table manually with compatible column types and set schema_save_mode = ERROR_WHEN_SCHEMA_NOT_EXIST (or RECREATE) so reconvert is not asked to map unsupported types.
- Cast the field to a supported scalar SeaTunnel type upstream (e.g. serialize nested data to a STRING field).
- Upgrade SeaTunnel — DM dialect type coverage expands between releases.
- If needed, add a case for the SeaTunnel type in DmdbTypeConverter.reconvert() mapping it to an appropriate DM column type.
Example fix
// before: auto-create table with MAP field -> fails
sink {
Jdbc {
url = "jdbc:dm://host:5236"
schema_save_mode = "CREATE_SCHEMA_WHEN_NOT_EXIST"
}
}
// after: pre-create the DM table and skip auto-creation
sink {
Jdbc {
url = "jdbc:dm://host:5236"
schema_save_mode = "ERROR_WHEN_SCHEMA_NOT_EXIST"
// DM table created with compatible scalar columns; nested fields serialized to CLOB
}
} Defensive patterns
Strategy: validation
Validate before calling
// Before enabling auto table creation on a DM sink, check the SeaTunnel schema types
CatalogTable table = ...;
for (CatalogColumn col : table.getTableSchema().getColumns()) {
if (!(col.getDataType() instanceof SeaTunnelPrimitiveType)) {
throw new IllegalArgumentException(
"Column " + col.getName() + " type " + col.getDataType()
+ " cannot auto-create in DM; flatten or pre-create the table.");
}
} Type guard
// Java: ensure every field in the SeaTunnel row is a scalar type before the DM sink
static boolean allScalarTypes(CatalogTable t) {
return t.getTableSchema().getColumns().stream()
.allMatch(c -> c.getDataType() instanceof SeaTunnelPrimitiveType);
} Try / catch
try {
sink.write(...);
} catch (SeaTunnelRuntimeException e) {
if (e.getMessage().contains("COMMON-19")) {
// pre-create the DM table with explicit column types, or flatten complex fields upstream
throw new IllegalArgumentException("Create DM table manually or convert complex fields to scalar", e);
}
throw e;
} Prevention
- Avoid ARRAY/MAP/ROW fields at the DM sink boundary; serialize them to STRING with a transform.
- Pre-create target tables with explicit DDL instead of relying on schema_save_mode auto-creation.
- Keep source and sink schemas aligned and re-validate after upstream schema changes.
When it happens
Trigger: Writing to a Dameng database via the JDBC sink with schema_save_mode = CREATE_SCHEMA_WHEN_NOT_EXIST (or a schema evolution mode) when the upstream SeaTunnel schema contains a data type that reconvert() cannot map — most commonly complex types (ARRAY, MAP, ROW/struct) or a source that produced types DM has no direct column type for.
Common situations: Chaining a source that emits complex types (e.g. a JSON/Nested source or a transform producing MAP/ARRAY fields) directly into a DM sink with auto table creation enabled. Also seen when the upstream table gained a new column of an unmappable type after the job was configured.
Related errors
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/d62bbfe12217ed84.
Report an issue: GitHub.