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

DB2 JDBC dialect failed to map a SeaTunnel data type back to a DB2 column type. DB2TypeConverter.reconvert switches on the column's SqlType; when no case matches (only basic numerics/strings/date-time types are supported) it throws CommonError.convertToConnectorTypeError with dialect DB_2, the SqlType name, and the column name.

Source

Thrown at seatunnel-connectors-v2/connector-jdbc/src/main/java/org/apache/seatunnel/connectors/seatunnel/jdbc/internal/dialect/db2/DB2TypeConverter.java:415

                        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(String.format("%s(%s)", DB2_TIMESTAMP, timestampScale));
                    builder.scale(timestampScale);
                } else {
                    builder.columnType(DB2_TIMESTAMP);
                }
                builder.dataType(DB2_TIMESTAMP);
                break;
            default:
                throw CommonError.convertToConnectorTypeError(
                        DatabaseIdentifier.DB_2,
                        column.getDataType().getSqlType().name(),
                        column.getName());
        }
        return builder.build();
    }
}

View on GitHub (pinned to cf67b549a7)

Solutions

  1. Convert the offending field to a supported DB2-representable type (string, numeric, date/time) before the sink
  2. Pre-create the DB2 table and use a column mapping / cast the data rather than relying on auto DDL
  3. Extend the reconvert switch to map the missing SqlType to a suitable DB2 type

Example fix

// before
SeaTunnel column: payload (ARRAY<STRING>) -> DB2 sink
// after
SeaTunnel column: payload (STRING, JSON-serialized array) -> DB2 sink
Defensive patterns

Strategy: validation

Validate before calling

for (SeaTunnelColumn col : columns) {
    SqlType st = col.getDataType().getSqlType();
    if (st == SqlType.MAP || st == SqlType.ARRAY || st == SqlType.ROW || st == SqlType.BYTES) {
        throw new IllegalArgumentException("Column '" + col.getName() + "' type " + st + " not supported by DB2 reconvert; cast before sink");
    }
}

Try / catch

try {
    return db2Converter.reconvert(column);
} catch (SeaTunnelRuntimeException e) {
    if (CommonErrorCode.CONVERT_TO_CONNECTOR_TYPE_ERROR_SIMPLE.equals(e.getSeaTunnelErrorCode())) {
        log.warn("Falling back to VARCHAR for DB2 column {}", column.getName());
        return BasicType.STRING_TYPE;
    }
    throw e;
}

Prevention

When it happens

Trigger: Calling DB2TypeConverter.reconvert(Column) during sink-side schema conversion / auto table creation when the SeaTunnel column type is a complex or unsupported type (e.g. MAP, ARRAY, BYTES).

Common situations: Auto-creating DB2 tables from upstream schemas containing complex types; chained pipelines where a source emitted array/map columns destined for DB2; sinks using dialect-driven DDL generation.

Related errors


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