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
SAP HANA JDBC connector's SapHanaTypeConverter.reconvert() maps a SeaTunnel column type back to the HANA SQL column type when writing. When the column's SeaTunnel SqlType falls into the switch's default branch (no HANA mapping exists, e.g. MAP/ARRAY/unsupported types), it throws CommonError.convertToConnectorTypeError. This is a hard stop: the sink cannot serialize that field into a HANA column type.
Source
Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/saphana/SapHanaTypeConverter.java:460
int timestampScale = column.getScale();
if (column.getScale() > MAX_TIMESTAMP_SCALE) {
timestampScale = MAX_TIMESTAMP_SCALE;
log.warn(
"The timestamp column {} type timestamp({}) is out of range, "
+ "which exceeds the maximum scale of {}, "
+ "it will be converted to timestamp({})",
column.getName(),
column.getScale(),
MAX_TIMESTAMP_SCALE,
timestampScale);
}
builder.columnType(HANA_TIMESTAMP);
builder.dataType(HANA_TIMESTAMP);
builder.scale(timestampScale);
}
break;
default:
throw CommonError.convertToConnectorTypeError(
DatabaseIdentifier.SAP_HANA,
column.getDataType().getSqlType().name(),
column.getName());
}
BasicTypeDefine typeDefine = builder.build();
typeDefine.setColumnType(
appendColumnSizeIfNeed(
typeDefine.getColumnType(), typeDefine.getLength(), typeDefine.getScale()));
return typeDefine;
}
public static String appendColumnSizeIfNeed(String columnType, Long length, Integer scale) {
if (shouldAppendLength.contains(columnType) && length != null && length != 0) {
return columnType + "(" + length + ")";
} else if (columnType.equalsIgnoreCase(HANA_DECIMAL)
&& length != null
&& scale != null
&& length != 0) {View on GitHub (pinned to cf67b549a7)
Solutions
- Flatten or cast the offending field to a supported scalar type (STRING, INT, TIMESTAMP, etc.) before the HANA sink using a transform (e.g. SQL transform / JsonPath).
- Exclude the unsupported column from the sink's schema (remove it from the table_path/schema or use a field filter).
- If support is genuinely needed, add a case for the SqlType in SapHanaTypeConverter.reconvert() and/or the upstream converter and contribute the mapping.
- Disable auto table creation and pre-create the HANA table with an explicit compatible DDL.
Example fix
// before: passing MAP column straight to HANA sink
// after: add a transform that flattens/casts it
transform {
Sql {
source_table_name = "src"
result_table_name = "flat"
query = "SELECT id, CAST(attrs AS STRING) AS attrs_str FROM src"
}
} Defensive patterns
Strategy: validation
Validate before calling
// Inspect the SeaTunnel schema before the HANA sink
CatalogTable table = ...;
for (Column c : table.getTableSchema().getColumns()) {
switch (c.getDataType().getSqlType()) {
case STRING: case INT: case BIGINT: case DOUBLE: case DECIMAL:
case BOOLEAN: case DATE: case TIMESTAMP: case BYTES:
break;
default:
throw new IllegalStateException(
"Column " + c.getName() + " type " + c.getDataType().getSqlType()
+ " needs flattening/casting before SAP HANA sink");
}
} Try / catch
try {
catalogTable = sink.createCatalogTable(...);
} catch (SeaTunnelRuntimeException e) {
if (e.getMessage().contains("unsupported convert SeaTunnel data type")) {
// flatten/cast offending column and retry
} else { throw e; }
} Prevention
- Flatten nested types at the source/transform stage before any JDBC sink.
- Pre-create HANA tables with explicit DDL instead of auto-creation.
- Keep the SeaTunnel->HANA type mapping table handy when designing pipelines.
- Run schema validation in a dry-run before production writes.
When it happens
Trigger: Calling reconvert() on a Column whose DataType.getSqlType() has no case in the HANA switch — e.g. a SeaTunnel MAP, ARRAY, ROW or otherwise unmapped type flowing into a SAP HANA sink during table auto-creation or schema mapping.
Common situations: Upstream source (e.g. a file or NoSQL connector) produces nested types that HANA sink cannot map; users set auto-Create table with schema containing complex types; type translation pipeline routes an exotic type to HANA.
Related errors
- COMMON-19
- DATA_TYPE_CAST_FAILED
- UNSUPPORTED_DATA_TYPE
- NOT_SUPPORT_TYPE
- Not support convert to milvus type, sqlType is %s
AI-assisted analysis of apache/seatunnel@cf67b549a7 (2026-09-10).
Data as JSON: /api/errors/777be9643b4f039f.
Report an issue: GitHub.